Documentation

Init.Data.Nat.Linear

Helper definitions and theorems for constructing linear arithmetic proofs.

@[reducible, inline]
Equations
@[reducible, inline]
Equations

When encoding polynomials. We use fixedVar for encoding numerals. The denotation of fixedVar is always 1.

Equations
@[reducible, inline]
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
  • p.norm = p.sort.fuse
Equations
  • e.toNormPoly = e.toPoly.norm
Equations
  • c₁.combine c₂ = match (c₁.lhs.combine c₂.lhs).cancel (c₁.rhs.combine c₂.rhs) with | (lhs, rhs) => { eq := c₁.eq && c₂.eq, lhs := lhs, rhs := rhs }
Equations
  • c.norm = match c.lhs.sort.fuse.cancel c.rhs.sort.fuse with | (lhs, rhs) => { eq := c.eq, lhs := lhs, rhs := rhs }
Equations
  • c.isUnsat = bif c.eq then c.lhs.isZero && c.rhs.isNonZero || c.lhs.isNonZero && c.rhs.isZero else c.lhs.isNonZero && c.rhs.isZero
Equations
  • c.isValid = bif c.eq then c.lhs.isZero && c.rhs.isZero else c.lhs.isZero
Equations
  • c.toPoly = { eq := c.eq, lhs := c.lhs.toPoly, rhs := c.rhs.toPoly }
Equations
  • c.toNormPoly = match c.lhs.toNormPoly.cancel c.rhs.toNormPoly with | (lhs, rhs) => { eq := c.eq, lhs := lhs, rhs := rhs }
Equations
Equations
  • c.toExpr = { eq := c.eq, lhs := c.lhs.toExpr, rhs := c.rhs.toExpr }
theorem Nat.Linear.Expr.of_cancel_eq (ctx : Nat.Linear.Context) (a : Nat.Linear.Expr) (b : Nat.Linear.Expr) (c : Nat.Linear.Expr) (d : Nat.Linear.Expr) (h : a.toNormPoly.cancel b.toNormPoly = (c.toPoly, d.toPoly)) :
theorem Nat.Linear.Expr.of_cancel_le (ctx : Nat.Linear.Context) (a : Nat.Linear.Expr) (b : Nat.Linear.Expr) (c : Nat.Linear.Expr) (d : Nat.Linear.Expr) (h : a.toNormPoly.cancel b.toNormPoly = (c.toPoly, d.toPoly)) :
theorem Nat.Linear.Expr.of_cancel_lt (ctx : Nat.Linear.Context) (a : Nat.Linear.Expr) (b : Nat.Linear.Expr) (c : Nat.Linear.Expr) (d : Nat.Linear.Expr) (h : a.inc.toNormPoly.cancel b.toNormPoly = (c.inc.toPoly, d.toPoly)) :
theorem Nat.Linear.ExprCnstr.toPoly_norm_eq (c : Nat.Linear.ExprCnstr) :
c.toPoly.norm = c.toNormPoly
def Nat.elimOffset {α : Sort u} (a : Nat) (b : Nat) (k : Nat) (h₁ : a + k = b + k) (h₂ : a = bα) :
α
Equations
  • a.elimOffset b k h₁ h₂ = h₂