Support for the linear arithmetic module for IntModule
in grind
@[reducible, inline]
Equations
Instances For
Equations
Instances For
theorem
Lean.Grind.Linarith.instAssociativeHAdd
{α : Type u_1}
[IntModule α]
:
Std.Associative fun (x1 x2 : α) => x1 + x2
theorem
Lean.Grind.Linarith.instCommutativeHAdd
{α : Type u_1}
[IntModule α]
:
Std.Commutative fun (x1 x2 : α) => x1 + x2
theorem
Lean.Grind.Linarith.Poly.denote'_go_eq_denote
{α : Type u_1}
[IntModule α]
(ctx : Context α)
(p : Poly)
(r : α)
:
Normalizes the given polynomial by fusing monomial and constants.
Equations
Instances For
Converts the given expression into a polynomial.
Equations
Instances For
Converts the given expression into a polynomial, and then normalizes it.
Equations
Instances For
theorem
Lean.Grind.Linarith.Expr.denote_norm
{α : Type u_1}
[IntModule α]
(ctx : Context α)
(e : Expr)
:
Helper theorems for conflict resolution during model construction.
theorem
Lean.Grind.Linarith.le_le_combine
{α : Type u_1}
[IntModule α]
[Preorder α]
[OrderedAdd α]
(ctx : Context α)
(p₁ p₂ p₃ : Poly)
:
le_le_combine_cert p₁ p₂ p₃ = true → Poly.denote' ctx p₁ ≤ 0 → Poly.denote' ctx p₂ ≤ 0 → Poly.denote' ctx p₃ ≤ 0
theorem
Lean.Grind.Linarith.le_lt_combine
{α : Type u_1}
[IntModule α]
[Preorder α]
[OrderedAdd α]
(ctx : Context α)
(p₁ p₂ p₃ : Poly)
:
le_lt_combine_cert p₁ p₂ p₃ = true → Poly.denote' ctx p₁ ≤ 0 → Poly.denote' ctx p₂ < 0 → Poly.denote' ctx p₃ < 0
theorem
Lean.Grind.Linarith.lt_lt_combine
{α : Type u_1}
[IntModule α]
[Preorder α]
[OrderedAdd α]
(ctx : Context α)
(p₁ p₂ p₃ : Poly)
:
lt_lt_combine_cert p₁ p₂ p₃ = true → Poly.denote' ctx p₁ < 0 → Poly.denote' ctx p₂ < 0 → Poly.denote' ctx p₃ < 0
theorem
Lean.Grind.Linarith.diseq_split
{α : Type u_1}
[IntModule α]
[LinearOrder α]
[OrderedAdd α]
(ctx : Context α)
(p₁ p₂ : Poly)
:
diseq_split_cert p₁ p₂ = true → Poly.denote' ctx p₁ ≠ 0 → Poly.denote' ctx p₁ < 0 ∨ Poly.denote' ctx p₂ < 0
theorem
Lean.Grind.Linarith.diseq_split_resolve
{α : Type u_1}
[IntModule α]
[LinearOrder α]
[OrderedAdd α]
(ctx : Context α)
(p₁ p₂ : Poly)
:
diseq_split_cert p₁ p₂ = true → Poly.denote' ctx p₁ ≠ 0 → ¬Poly.denote' ctx p₁ < 0 → Poly.denote' ctx p₂ < 0
Helper theorems for internalizing facts into the linear arithmetic procedure
theorem
Lean.Grind.Linarith.eq_norm
{α : Type u_1}
[IntModule α]
(ctx : Context α)
(lhs rhs : Expr)
(p : Poly)
:
norm_cert lhs rhs p = true → Expr.denote ctx lhs = Expr.denote ctx rhs → Poly.denote' ctx p = 0
theorem
Lean.Grind.Linarith.le_of_eq
{α : Type u_1}
[IntModule α]
[Preorder α]
[OrderedAdd α]
(ctx : Context α)
(lhs rhs : Expr)
(p : Poly)
:
norm_cert lhs rhs p = true → Expr.denote ctx lhs = Expr.denote ctx rhs → Poly.denote' ctx p ≤ 0
theorem
Lean.Grind.Linarith.diseq_norm
{α : Type u_1}
[IntModule α]
(ctx : Context α)
(lhs rhs : Expr)
(p : Poly)
:
norm_cert lhs rhs p = true → Expr.denote ctx lhs ≠ Expr.denote ctx rhs → Poly.denote' ctx p ≠ 0
theorem
Lean.Grind.Linarith.le_norm
{α : Type u_1}
[IntModule α]
[Preorder α]
[OrderedAdd α]
(ctx : Context α)
(lhs rhs : Expr)
(p : Poly)
:
norm_cert lhs rhs p = true → Expr.denote ctx lhs ≤ Expr.denote ctx rhs → Poly.denote' ctx p ≤ 0
theorem
Lean.Grind.Linarith.lt_norm
{α : Type u_1}
[IntModule α]
[Preorder α]
[OrderedAdd α]
(ctx : Context α)
(lhs rhs : Expr)
(p : Poly)
:
norm_cert lhs rhs p = true → Expr.denote ctx lhs < Expr.denote ctx rhs → Poly.denote' ctx p < 0
theorem
Lean.Grind.Linarith.not_le_norm
{α : Type u_1}
[IntModule α]
[LinearOrder α]
[OrderedAdd α]
(ctx : Context α)
(lhs rhs : Expr)
(p : Poly)
:
norm_cert rhs lhs p = true → ¬Expr.denote ctx lhs ≤ Expr.denote ctx rhs → Poly.denote' ctx p < 0
theorem
Lean.Grind.Linarith.not_lt_norm
{α : Type u_1}
[IntModule α]
[LinearOrder α]
[OrderedAdd α]
(ctx : Context α)
(lhs rhs : Expr)
(p : Poly)
:
norm_cert rhs lhs p = true → ¬Expr.denote ctx lhs < Expr.denote ctx rhs → Poly.denote' ctx p ≤ 0
theorem
Lean.Grind.Linarith.not_le_norm'
{α : Type u_1}
[IntModule α]
[Preorder α]
[OrderedAdd α]
(ctx : Context α)
(lhs rhs : Expr)
(p : Poly)
:
norm_cert lhs rhs p = true → ¬Expr.denote ctx lhs ≤ Expr.denote ctx rhs → ¬Poly.denote' ctx p ≤ 0
theorem
Lean.Grind.Linarith.not_lt_norm'
{α : Type u_1}
[IntModule α]
[Preorder α]
[OrderedAdd α]
(ctx : Context α)
(lhs rhs : Expr)
(p : Poly)
:
norm_cert lhs rhs p = true → ¬Expr.denote ctx lhs < Expr.denote ctx rhs → ¬Poly.denote' ctx p < 0
Equality detection
theorem
Lean.Grind.Linarith.eq_of_le_ge
{α : Type u_1}
[IntModule α]
[PartialOrder α]
[OrderedAdd α]
(ctx : Context α)
(p₁ p₂ : Poly)
:
eq_of_le_ge_cert p₁ p₂ = true → Poly.denote' ctx p₁ ≤ 0 → Poly.denote' ctx p₂ ≤ 0 → Poly.denote' ctx p₁ = 0
Helper theorems for closing the goal
theorem
Lean.Grind.Linarith.diseq_unsat
{α : Type u_1}
[IntModule α]
(ctx : Context α)
:
Poly.denote ctx Poly.nil ≠ 0 → False
theorem
Lean.Grind.Linarith.lt_unsat
{α : Type u_1}
[IntModule α]
[Preorder α]
(ctx : Context α)
:
Poly.denote ctx Poly.nil < 0 → False
theorem
Lean.Grind.Linarith.zero_lt_one
{α : Type u_1}
[Ring α]
[Preorder α]
[OrderedRing α]
(ctx : Context α)
(p : Poly)
:
zero_lt_one_cert p = true → Var.denote ctx 0 = One.one → Poly.denote' ctx p < 0
theorem
Lean.Grind.Linarith.zero_ne_one_of_ord_ring
{α : Type u_1}
[Ring α]
[Preorder α]
[OrderedRing α]
(ctx : Context α)
(p : Poly)
:
zero_ne_one_cert p = true → Var.denote ctx 0 = One.one → Poly.denote' ctx p ≠ 0
theorem
Lean.Grind.Linarith.zero_ne_one_of_field
{α : Type u_1}
[Field α]
(ctx : Context α)
(p : Poly)
:
zero_ne_one_cert p = true → Var.denote ctx 0 = One.one → Poly.denote' ctx p ≠ 0
theorem
Lean.Grind.Linarith.zero_ne_one_of_char0
{α : Type u_1}
[Ring α]
[IsCharP α 0]
(ctx : Context α)
(p : Poly)
:
zero_ne_one_cert p = true → Var.denote ctx 0 = One.one → Poly.denote' ctx p ≠ 0
Equations
Instances For
theorem
Lean.Grind.Linarith.zero_ne_one_of_charC
{α : Type u_1}
{c : Nat}
[Ring α]
[IsCharP α c]
(ctx : Context α)
(p : Poly)
:
zero_ne_one_of_charC_cert c p = true → Var.denote ctx 0 = One.one → Poly.denote' ctx p ≠ 0
Coefficient normalization
theorem
Lean.Grind.Linarith.eq_neg
{α : Type u_1}
[IntModule α]
(ctx : Context α)
(p₁ p₂ : Poly)
:
eq_neg_cert p₁ p₂ = true → Poly.denote' ctx p₁ = 0 → Poly.denote' ctx p₂ = 0
theorem
Lean.Grind.Linarith.eq_coeff
{α : Type u_1}
[IntModule α]
[NoNatZeroDivisors α]
(ctx : Context α)
(p₁ p₂ : Poly)
(k : Nat)
:
eq_coeff_cert p₁ p₂ k = true → Poly.denote' ctx p₁ = 0 → Poly.denote' ctx p₂ = 0
theorem
Lean.Grind.Linarith.le_coeff
{α : Type u_1}
[IntModule α]
[LinearOrder α]
[OrderedAdd α]
(ctx : Context α)
(p₁ p₂ : Poly)
(k : Nat)
:
coeff_cert p₁ p₂ k = true → Poly.denote' ctx p₁ ≤ 0 → Poly.denote' ctx p₂ ≤ 0
theorem
Lean.Grind.Linarith.lt_coeff
{α : Type u_1}
[IntModule α]
[LinearOrder α]
[OrderedAdd α]
(ctx : Context α)
(p₁ p₂ : Poly)
(k : Nat)
:
coeff_cert p₁ p₂ k = true → Poly.denote' ctx p₁ < 0 → Poly.denote' ctx p₂ < 0
theorem
Lean.Grind.Linarith.diseq_neg
{α : Type u_1}
[IntModule α]
(ctx : Context α)
(p p' : Poly)
:
(p' == p.mul (-1)) = true → Poly.denote' ctx p ≠ 0 → Poly.denote' ctx p' ≠ 0
Substitution
Equations
Instances For
theorem
Lean.Grind.Linarith.eq_diseq_subst
{α : Type u_1}
[IntModule α]
[NoNatZeroDivisors α]
(ctx : Context α)
(k₁ k₂ : Int)
(p₁ p₂ p₃ : Poly)
:
eq_diseq_subst_cert k₁ k₂ p₁ p₂ p₃ = true → Poly.denote' ctx p₁ = 0 → Poly.denote' ctx p₂ ≠ 0 → Poly.denote' ctx p₃ ≠ 0
Equations
Instances For
theorem
Lean.Grind.Linarith.eq_diseq_subst1
{α : Type u_1}
[IntModule α]
(ctx : Context α)
(k : Int)
(p₁ p₂ p₃ : Poly)
:
eq_diseq_subst1_cert k p₁ p₂ p₃ = true → Poly.denote' ctx p₁ = 0 → Poly.denote' ctx p₂ ≠ 0 → Poly.denote' ctx p₃ ≠ 0
Equations
Instances For
theorem
Lean.Grind.Linarith.eq_le_subst
{α : Type u_1}
[IntModule α]
[Preorder α]
[OrderedAdd α]
(ctx : Context α)
(x : Var)
(p₁ p₂ p₃ : Poly)
:
eq_le_subst_cert x p₁ p₂ p₃ = true → Poly.denote' ctx p₁ = 0 → Poly.denote' ctx p₂ ≤ 0 → Poly.denote' ctx p₃ ≤ 0
Equations
Instances For
theorem
Lean.Grind.Linarith.eq_lt_subst
{α : Type u_1}
[IntModule α]
[Preorder α]
[OrderedAdd α]
(ctx : Context α)
(x : Var)
(p₁ p₂ p₃ : Poly)
:
eq_lt_subst_cert x p₁ p₂ p₃ = true → Poly.denote' ctx p₁ = 0 → Poly.denote' ctx p₂ < 0 → Poly.denote' ctx p₃ < 0
Equations
Instances For
theorem
Lean.Grind.Linarith.eq_eq_subst
{α : Type u_1}
[IntModule α]
(ctx : Context α)
(x : Var)
(p₁ p₂ p₃ : Poly)
:
eq_eq_subst_cert x p₁ p₂ p₃ = true → Poly.denote' ctx p₁ = 0 → Poly.denote' ctx p₂ = 0 → Poly.denote' ctx p₃ = 0