fix: use default reducibility when proving equation theorems for definition

Addresses issue reported by @fpfu at #945
This commit is contained in:
Leonardo de Moura 2022-01-20 08:21:59 -08:00
parent 9949f92648
commit d190d6dda4
2 changed files with 10 additions and 1 deletions

View file

@ -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

View 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⟩