fix: use default reducibility when proving equation theorems for definition
Addresses issue reported by @fpfu at #945
This commit is contained in:
parent
9949f92648
commit
d190d6dda4
2 changed files with 10 additions and 1 deletions
|
|
@ -187,7 +187,7 @@ partial def proveCondEqThm (matchDeclName : Name) (type : Expr) : MetaM Expr :=
|
|||
let mvar0 ← mkFreshExprSyntheticOpaqueMVar target
|
||||
let mvarId ← deltaTarget mvar0.mvarId! (. == matchDeclName)
|
||||
trace[Meta.Match.matchEqs] "{MessageData.ofGoal mvarId}"
|
||||
go mvarId 0
|
||||
withDefault <| go mvarId 0
|
||||
mkLambdaFVars ys (← instantiateMVars mvar0)
|
||||
where
|
||||
go (mvarId : MVarId) (depth : Nat) : MetaM Unit := withIncRecDepth do
|
||||
|
|
|
|||
9
tests/lean/run/eqTheoremForVec.lean
Normal file
9
tests/lean/run/eqTheoremForVec.lean
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
inductive Vector (α : Type u): Nat → Type u where
|
||||
| nil : Vector α 0
|
||||
| cons (head : α) (tail : Vector α n) : Vector α (n+1)
|
||||
|
||||
theorem Nat.lt_of_add_lt_add_right {a b c : Nat} (h : a + b < c + b) : a < c := sorry
|
||||
|
||||
def Vector.nth : ∀{n}, Vector α n → Fin n → α
|
||||
| n+1, Vector.cons x xs, ⟨ 0, _⟩ => x
|
||||
| n+1, Vector.cons x xs, ⟨k+1, h⟩ => xs.nth ⟨k, Nat.lt_of_add_lt_add_right h⟩
|
||||
Loading…
Add table
Reference in a new issue