fix: type incorrect term produced by contradiction (#6387)
This PR fixes a type error in the proof generated by the `contradiction` tactic. closes #4851
This commit is contained in:
parent
94641e88cf
commit
e08d35cea1
2 changed files with 4 additions and 1 deletions
|
|
@ -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
2
tests/lean/run/4851.lean
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
theorem T0 (α : Type) (x : α) (H: α → False) : False := by
|
||||
contradiction
|
||||
Loading…
Add table
Reference in a new issue