fix: bug in reduceLeDiff simproc proof term (#4065)

As [reported on
Zulip](https://leanprover.zulipchat.com/#narrow/stream/348111-std4/topic/v4.2E8.2E0-rc1.20issue/near/437059527).
This commit is contained in:
Mario Carneiro 2024-05-05 03:44:36 -04:00 committed by GitHub
parent e362b50fa9
commit 93d7afb00a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View file

@ -275,7 +275,7 @@ def reduceLTLE (nm : Name) (arity : Nat) (isLT : Bool) (e : Expr) : SimpM Step :
applySimprocConst (mkConst ``True) ``Nat.Simproc.le_add_le #[x, yb, yo, leProof]
else
let finExpr := mkLENat (toExpr (xn - yn)) yb
let geProof ← mkOfDecideEqTrue (mkGENat yo x)
let geProof ← mkOfDecideEqTrue (mkGENat x yo)
applySimprocConst finExpr ``Nat.Simproc.le_add_ge #[x, yb, yo, geProof]
| .offset xb xo xn, .offset yb yo yn => do
if xn ≤ yn then

View file

@ -32,3 +32,5 @@ example : x + foo 2 = 12 + x := by
-- We can use `-` to disable `simproc`s
fail_if_success simp [-reduce_foo]
simp_arith
example (x : Nat) (h : x < 86) : ¬100 ≤ x + 14 := by simp; exact h