Compare commits

...

1 Commits

Author SHA1 Message Date
Leonardo de Moura
ac6ea18cc6 fix: type incorrect term produced by contradiction
This PR fixes a type error in the proof generated by the `contradiction` tactic.

closes #4851
2024-12-14 15:59:56 -08:00
2 changed files with 4 additions and 1 deletions

View File

@@ -160,7 +160,8 @@ def _root_.Lean.MVarId.contradictionCore (mvarId : MVarId) (config : Contradicti
-- (h : ¬ p) (h' : p)
if let some p matchNot? localDecl.type then
if let some pFVarId findLocalDeclWithType? p then
mvarId.assign ( mkAbsurd ( mvarId.getType) (mkFVar pFVarId) localDecl.toExpr)
-- We use `False.elim` because `p`'s type may be Type
mvarId.assign ( mkFalseElim ( mvarId.getType) (mkApp localDecl.toExpr (mkFVar pFVarId)))
return true
-- (h : x ≠ x)
if let some (_, lhs, rhs) matchNe? localDecl.type then

2
tests/lean/run/4851.lean Normal file
View File

@@ -0,0 +1,2 @@
theorem T0 (α : Type) (x : α) (H: α False) : False := by
contradiction