Skip to content

Commit

Permalink
feat: check cgRoot at Inv.lean
Browse files Browse the repository at this point in the history
  • Loading branch information
leodemoura committed Dec 28, 2024
1 parent 1059307 commit 0fef828
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Lean/Meta/Tactic/Grind/Inv.lean
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ private def checkEqc (root : ENode) : GoalM Unit := do
size := size + 1
-- The root of `curr` must be `root`
assert! isSameExpr (← getRoot curr) root.self
-- Check congruence root
if curr.isApp then
if let some { e } := (← get).congrTable.find? { e := curr } then
if (← hasSameType e.getAppFn curr.getAppFn) then
assert! isSameExpr e (← getENode curr).cgRoot
else
assert! isSameExpr curr (← getENode curr).cgRoot
-- If the equivalence class does not have HEq proofs, then the types must be definitionally equal.
unless root.heqProofs do
assert! (← hasSameType curr root.self)
Expand Down

0 comments on commit 0fef828

Please sign in to comment.