Parameters of the certificates by Kronecker substitution (Init/Grind/Ring/Kronecker.lean): the
elaborator side of the bounds that the kernel checks.
The estimates below saturate at 2 ^ kronSatBits, which is larger than the bit limit of every
Kronecker certificate: an estimate that reaches it rejects the certificate (kronExponent?), and
the estimate is never computed in full. Without saturation, ((x - x) ^ 64) ^ 64 … builds integers
of billions of bits.
Equations
Instances For
a ^ k, or a value of at least 2 ^ kronSatBits if a ^ k is larger. A saturated a stays
saturated even for k = 0: the kernel still computes the estimate of the base.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The degree bound Grind.CommRing.Expr.degB_k of e.
Equations
- Lean.Meta.Sym.Arith.exprDegB (Lean.Grind.CommRing.Expr.num k) = 0
- Lean.Meta.Sym.Arith.exprDegB (Lean.Grind.CommRing.Expr.natCast k) = 0
- Lean.Meta.Sym.Arith.exprDegB (Lean.Grind.CommRing.Expr.intCast k) = 0
- Lean.Meta.Sym.Arith.exprDegB (Lean.Grind.CommRing.Expr.var i) = 1
- Lean.Meta.Sym.Arith.exprDegB a.neg = Lean.Meta.Sym.Arith.exprDegB a
- Lean.Meta.Sym.Arith.exprDegB (a.add b) = max (Lean.Meta.Sym.Arith.exprDegB a) (Lean.Meta.Sym.Arith.exprDegB b)
- Lean.Meta.Sym.Arith.exprDegB (a.sub b) = max (Lean.Meta.Sym.Arith.exprDegB a) (Lean.Meta.Sym.Arith.exprDegB b)
- Lean.Meta.Sym.Arith.exprDegB (a.mul b) = Lean.Meta.Sym.Arith.exprDegB a + Lean.Meta.Sym.Arith.exprDegB b
- Lean.Meta.Sym.Arith.exprDegB (a.pow k) = Lean.Meta.Sym.Arith.exprDegB a * k
Instances For
Grind.CommRing.Expr.lin_k e: exprDegB with ||| in place of the maximum.
Equations
- Lean.Meta.Sym.Arith.exprLin (Lean.Grind.CommRing.Expr.num k) = 0
- Lean.Meta.Sym.Arith.exprLin (Lean.Grind.CommRing.Expr.natCast k) = 0
- Lean.Meta.Sym.Arith.exprLin (Lean.Grind.CommRing.Expr.intCast k) = 0
- Lean.Meta.Sym.Arith.exprLin (Lean.Grind.CommRing.Expr.var i) = 1
- Lean.Meta.Sym.Arith.exprLin a.neg = Lean.Meta.Sym.Arith.exprLin a
- Lean.Meta.Sym.Arith.exprLin (a.add b) = Lean.Meta.Sym.Arith.exprLin a ||| Lean.Meta.Sym.Arith.exprLin b
- Lean.Meta.Sym.Arith.exprLin (a.sub b) = Lean.Meta.Sym.Arith.exprLin a ||| Lean.Meta.Sym.Arith.exprLin b
- Lean.Meta.Sym.Arith.exprLin (a.mul b) = Lean.Meta.Sym.Arith.exprLin a + Lean.Meta.Sym.Arith.exprLin b
- Lean.Meta.Sym.Arith.exprLin (a.pow k) = Lean.Meta.Sym.Arith.exprLin a * k
Instances For
Grind.CommRing.Expr.linS_k e: exprLin e, or at least 2 if e is not a semiring term.
Equations
- Lean.Meta.Sym.Arith.exprLinS (Lean.Grind.CommRing.Expr.num k) = if k ≥ 0 then 0 else 2
- Lean.Meta.Sym.Arith.exprLinS (Lean.Grind.CommRing.Expr.natCast k) = 0
- Lean.Meta.Sym.Arith.exprLinS (Lean.Grind.CommRing.Expr.var i) = 1
- Lean.Meta.Sym.Arith.exprLinS (Lean.Grind.CommRing.Expr.intCast k) = 2
- Lean.Meta.Sym.Arith.exprLinS a.neg = 2
- Lean.Meta.Sym.Arith.exprLinS (a.sub b) = 2
- Lean.Meta.Sym.Arith.exprLinS (a.add b) = Lean.Meta.Sym.Arith.exprLinS a ||| Lean.Meta.Sym.Arith.exprLinS b
- Lean.Meta.Sym.Arith.exprLinS (a.mul b) = Lean.Meta.Sym.Arith.exprLinS a + Lean.Meta.Sym.Arith.exprLinS b
- Lean.Meta.Sym.Arith.exprLinS (a.pow k) = have d := Lean.Meta.Sym.Arith.exprLinS a; if 2 ≤ d then 2 else d * k
Instances For
Grind.CommRing.Expr.degS_k B e: exprDegB e, or B if e is not a semiring term.
Equations
- Lean.Meta.Sym.Arith.exprDegS B (Lean.Grind.CommRing.Expr.num k) = if k ≥ 0 then 0 else B
- Lean.Meta.Sym.Arith.exprDegS B (Lean.Grind.CommRing.Expr.natCast k) = 0
- Lean.Meta.Sym.Arith.exprDegS B (Lean.Grind.CommRing.Expr.var i) = 1
- Lean.Meta.Sym.Arith.exprDegS B (Lean.Grind.CommRing.Expr.intCast k) = B
- Lean.Meta.Sym.Arith.exprDegS B a.neg = B
- Lean.Meta.Sym.Arith.exprDegS B (a.sub b) = B
- Lean.Meta.Sym.Arith.exprDegS B (a.add b) = max (Lean.Meta.Sym.Arith.exprDegS B a) (Lean.Meta.Sym.Arith.exprDegS B b)
- Lean.Meta.Sym.Arith.exprDegS B (a.mul b) = Lean.Meta.Sym.Arith.exprDegS B a + Lean.Meta.Sym.Arith.exprDegS B b
- Lean.Meta.Sym.Arith.exprDegS B (a.pow k) = have d := Lean.Meta.Sym.Arith.exprDegS B a; if B ≤ d then B else d * k
Instances For
true if normalizing e multiplies out a sum: a product or power with a sum of nonconstant
terms. Otherwise normalizing e only merges terms, and is cheaper than a Kronecker certificate.
Equations
- One or more equations did not get rendered due to their size.
- Lean.Meta.Sym.Arith.exprExpandsSum (a.pow k) = (decide (k ≥ 2) && Lean.Meta.Sym.Arith.exprExpandsSum.isSum✝ a || Lean.Meta.Sym.Arith.exprExpandsSum a)
- Lean.Meta.Sym.Arith.exprExpandsSum (a.add b) = (Lean.Meta.Sym.Arith.exprExpandsSum a || Lean.Meta.Sym.Arith.exprExpandsSum b)
- Lean.Meta.Sym.Arith.exprExpandsSum (a.sub b) = (Lean.Meta.Sym.Arith.exprExpandsSum a || Lean.Meta.Sym.Arith.exprExpandsSum b)
- Lean.Meta.Sym.Arith.exprExpandsSum a.neg = Lean.Meta.Sym.Arith.exprExpandsSum a
- Lean.Meta.Sym.Arith.exprExpandsSum x✝ = false
Instances For
The coefficient bound Grind.CommRing.Expr.majorant_k of e.
Equations
- Lean.Meta.Sym.Arith.exprMajorant (Lean.Grind.CommRing.Expr.num k) = k.natAbs
- Lean.Meta.Sym.Arith.exprMajorant (Lean.Grind.CommRing.Expr.intCast k) = k.natAbs
- Lean.Meta.Sym.Arith.exprMajorant (Lean.Grind.CommRing.Expr.natCast n) = n
- Lean.Meta.Sym.Arith.exprMajorant (Lean.Grind.CommRing.Expr.var i) = 1
- Lean.Meta.Sym.Arith.exprMajorant a.neg = Lean.Meta.Sym.Arith.exprMajorant a
- Lean.Meta.Sym.Arith.exprMajorant (a.add b) = Lean.Meta.Sym.Arith.exprMajorant a + Lean.Meta.Sym.Arith.exprMajorant b
- Lean.Meta.Sym.Arith.exprMajorant (a.sub b) = Lean.Meta.Sym.Arith.exprMajorant a + Lean.Meta.Sym.Arith.exprMajorant b
- Lean.Meta.Sym.Arith.exprMajorant (a.mul b) = Lean.Meta.Sym.Arith.satMul (Lean.Meta.Sym.Arith.exprMajorant a) (Lean.Meta.Sym.Arith.exprMajorant b)
- Lean.Meta.Sym.Arith.exprMajorant (a.pow k) = Lean.Meta.Sym.Arith.satPow (Lean.Meta.Sym.Arith.exprMajorant a) k
Instances For
The maximum degree of the monomials of p (Grind.CommRing.Poly.maxDeg_k).
Equations
Instances For
The sum of the absolute values of the coefficients of p (Grind.CommRing.Poly.norm1_k).
Equations
Instances For
The largest packed code of the monomials of p.
Equations
Instances For
An upper bound on the packed codes of the monomials of the polynomials of e and its subterms.
The base of a ^ 0 counts too, since the kernel evaluates it at the point.
Equations
- Lean.Meta.Sym.Arith.exprMaxCode B (Lean.Grind.CommRing.Expr.num k) = 0
- Lean.Meta.Sym.Arith.exprMaxCode B (Lean.Grind.CommRing.Expr.natCast k) = 0
- Lean.Meta.Sym.Arith.exprMaxCode B (Lean.Grind.CommRing.Expr.intCast k) = 0
- Lean.Meta.Sym.Arith.exprMaxCode B (Lean.Grind.CommRing.Expr.var i) = Lean.Meta.Sym.Arith.satPow B i
- Lean.Meta.Sym.Arith.exprMaxCode B a.neg = Lean.Meta.Sym.Arith.exprMaxCode B a
- Lean.Meta.Sym.Arith.exprMaxCode B (a.add b) = max (Lean.Meta.Sym.Arith.exprMaxCode B a) (Lean.Meta.Sym.Arith.exprMaxCode B b)
- Lean.Meta.Sym.Arith.exprMaxCode B (a.sub b) = max (Lean.Meta.Sym.Arith.exprMaxCode B a) (Lean.Meta.Sym.Arith.exprMaxCode B b)
- Lean.Meta.Sym.Arith.exprMaxCode B (a.mul b) = Lean.Meta.Sym.Arith.exprMaxCode B a + Lean.Meta.Sym.Arith.exprMaxCode B b
- Lean.Meta.Sym.Arith.exprMaxCode B (a.pow k) = have c := Lean.Meta.Sym.Arith.exprMaxCode B a; if k = 0 then c else Lean.Meta.Sym.Arith.satMul c k
Instances For
The exponent K of a Kronecker certificate whose coefficients are bounded by norm and whose
monomials have codes at most maxCode, if the values at the point stay below maxBits bits: they
have about K * maxCode bits.
Equations
Instances For
An upper bound on the codes of the values of e and its subterms at the point of the linear
certificates, where the variable x has code x + 1 (Grind.CommRing.Expr.toLin). For a linear
e, this is one more than its largest variable, but powers count, as in exprMaxCode: the kernel
evaluates x ^ k in (x ^ k) ^ 0.
Equations
- Lean.Meta.Sym.Arith.exprLinCode (Lean.Grind.CommRing.Expr.num k) = 0
- Lean.Meta.Sym.Arith.exprLinCode (Lean.Grind.CommRing.Expr.natCast k) = 0
- Lean.Meta.Sym.Arith.exprLinCode (Lean.Grind.CommRing.Expr.intCast k) = 0
- Lean.Meta.Sym.Arith.exprLinCode (Lean.Grind.CommRing.Expr.var i) = i + 1
- Lean.Meta.Sym.Arith.exprLinCode a.neg = Lean.Meta.Sym.Arith.exprLinCode a
- Lean.Meta.Sym.Arith.exprLinCode (a.add b) = max (Lean.Meta.Sym.Arith.exprLinCode a) (Lean.Meta.Sym.Arith.exprLinCode b)
- Lean.Meta.Sym.Arith.exprLinCode (a.sub b) = max (Lean.Meta.Sym.Arith.exprLinCode a) (Lean.Meta.Sym.Arith.exprLinCode b)
- Lean.Meta.Sym.Arith.exprLinCode (a.mul b) = Lean.Meta.Sym.Arith.exprLinCode a + Lean.Meta.Sym.Arith.exprLinCode b
- Lean.Meta.Sym.Arith.exprLinCode (a.pow k) = have c := Lean.Meta.Sym.Arith.exprLinCode a; if k = 0 then c else Lean.Meta.Sym.Arith.satMul c k
Instances For
The exponent K of the linear Kronecker certificate (Grind.CommRing.Expr.eq_of_kronLin) for
l and r, if they are linear and the values at the point stay below maxBits bits.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Grind.CommRing.InvVars.lookup_k: the search stops at the first larger variable.
Equations
Instances For
The coefficient bound and the denominator Grind.CommRing.Expr.majQ_k of e, where the variables
of invs denote the inverses of their numerals.
Equations
- One or more equations did not get rendered due to their size.
- Lean.Meta.Sym.Arith.exprMajQ invs (Lean.Grind.CommRing.Expr.num k) = (k.natAbs, 1)
- Lean.Meta.Sym.Arith.exprMajQ invs (Lean.Grind.CommRing.Expr.intCast k) = (k.natAbs, 1)
- Lean.Meta.Sym.Arith.exprMajQ invs (Lean.Grind.CommRing.Expr.natCast n) = (n, 1)
- Lean.Meta.Sym.Arith.exprMajQ invs (Lean.Grind.CommRing.Expr.var i) = match Lean.Meta.Sym.Arith.invLookup invs i with | some c => (1, c) | none => (1, 1)
- Lean.Meta.Sym.Arith.exprMajQ invs a.neg = Lean.Meta.Sym.Arith.exprMajQ invs a
- Lean.Meta.Sym.Arith.exprMajQ invs (a.pow k) = match Lean.Meta.Sym.Arith.exprMajQ invs a with | (m, d) => (Lean.Meta.Sym.Arith.satPow m k, Lean.Meta.Sym.Arith.satPow d k)
Instances For
The arguments K and B of the Kronecker certificate of a field identity
(Grind.CommRing.Expr.eq_of_kronQ) for l and r, if the values stay below maxBits bits.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Grind.CommRing.Expr.degQL_k: exprLin, where the variables of invs are constants.
Equations
- Lean.Meta.Sym.Arith.exprDegQL invs (Lean.Grind.CommRing.Expr.num k) = 0
- Lean.Meta.Sym.Arith.exprDegQL invs (Lean.Grind.CommRing.Expr.natCast k) = 0
- Lean.Meta.Sym.Arith.exprDegQL invs (Lean.Grind.CommRing.Expr.intCast k) = 0
- Lean.Meta.Sym.Arith.exprDegQL invs (Lean.Grind.CommRing.Expr.var i) = if (Lean.Meta.Sym.Arith.invLookup invs i).isSome = true then 0 else 1
- Lean.Meta.Sym.Arith.exprDegQL invs a.neg = Lean.Meta.Sym.Arith.exprDegQL invs a
- Lean.Meta.Sym.Arith.exprDegQL invs (a.add b) = Lean.Meta.Sym.Arith.exprDegQL invs a ||| Lean.Meta.Sym.Arith.exprDegQL invs b
- Lean.Meta.Sym.Arith.exprDegQL invs (a.sub b) = Lean.Meta.Sym.Arith.exprDegQL invs a ||| Lean.Meta.Sym.Arith.exprDegQL invs b
- Lean.Meta.Sym.Arith.exprDegQL invs (a.mul b) = Lean.Meta.Sym.Arith.exprDegQL invs a + Lean.Meta.Sym.Arith.exprDegQL invs b
- Lean.Meta.Sym.Arith.exprDegQL invs (a.pow k) = Lean.Meta.Sym.Arith.exprDegQL invs a * k
Instances For
The exponent K of the linear field certificate (Grind.CommRing.Expr.eq_of_kronQLin) for l
and r, if they are linear in the variables not in invs and the values stay below maxBits bits.
Equations
- One or more equations did not get rendered due to their size.