forked from leanprover/lean4
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: nontermination while generating equation lemmas for
match
-expr…
…essions (leanprover#6180) This PR fixes a non-termination bug that occurred when generating the match-expression equation theorems. The bug was triggered when the proof automation for the equation theorem repeatedly applied `injection(` to the same local declaration, as it could not be removed due to forward dependencies. See issue leanprover#6067 for an example that reproduces this issue. closes leanprover#6067
- Loading branch information
1 parent
b6a0d63
commit 4a69643
Showing
4 changed files
with
60 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
inductive Impl where | ||
| inner (l r : Impl) | ||
| leaf | ||
|
||
namespace Impl | ||
|
||
inductive Balanced : Impl → Prop where | ||
| leaf : Balanced leaf | ||
|
||
@[inline] | ||
def balanceLErase (r : Impl) (hrb : Balanced r) : Impl := | ||
match r with | ||
| leaf => .leaf | ||
| l@(inner _ _) => | ||
match l with | ||
| leaf => .leaf | ||
| r@(inner ll lr) => | ||
if true then | ||
match ll, lr with | ||
| inner _ _, inner _ _ => .leaf | ||
| _, _ => .leaf | ||
else .leaf | ||
|
||
theorem size_balanceLErase {r : Impl} {hrb} : (balanceLErase r hrb) = .leaf := by | ||
simp only [balanceLErase] | ||
sorry |