Documentation

HexPolyTheory.Interpret

noncomputable def HexPolyTheory.Interpret.interpret {E : Type u} {K : Type v} [Zero E] [DecidableEq E] [Field K] [DecidableEq K] (f : E → K) (hz : ∀ (x : E), f x = 0 ↔ x = 0) (p : Hex.DensePoly E) :

Interpret coefficients without identifying distinct stored nonzero values.

Equations
Instances For
    theorem HexPolyTheory.Interpret.interpret_map {E : Type u} {K : Type v} [Zero E] [DecidableEq E] [Field K] [DecidableEq K] (f : E → K) (hz : ∀ (x : E), f x = 0 ↔ x = 0) (p : Hex.DensePoly E) :

    Expose the polynomial correspondence without unfolding its implementation.

    @[simp]
    theorem HexPolyTheory.Interpret.coeff_interpret {E : Type u} {K : Type v} [Zero E] [DecidableEq E] [Field K] [DecidableEq K] (f : E → K) (hz : ∀ (x : E), f x = 0 ↔ x = 0) (p : Hex.DensePoly E) (i : ℕ) :
    (interpret f hz p).coeff i = f (p.coeff i)
    @[simp]
    theorem HexPolyTheory.Interpret.interpret_zero {E : Type u} {K : Type v} [Zero E] [DecidableEq E] [Field K] [DecidableEq K] (f : E → K) (hz : ∀ (x : E), f x = 0 ↔ x = 0) :
    interpret f hz 0 = 0
    theorem HexPolyTheory.Interpret.interpret_eq_zero {E : Type u} {K : Type v} [Zero E] [DecidableEq E] [Field K] [DecidableEq K] (f : E → K) (hz : ∀ (x : E), f x = 0 ↔ x = 0) (p : Hex.DensePoly E) :
    interpret f hz p = 0 ↔ p = 0

    Zero reflection is sufficient; injectivity of the coefficient map is not needed.

    @[simp]
    theorem HexPolyTheory.Interpret.natDegree_interpret {E : Type u} {K : Type v} [Zero E] [DecidableEq E] [Field K] [DecidableEq K] (f : E → K) (hz : ∀ (x : E), f x = 0 ↔ x = 0) (p : Hex.DensePoly E) :
    @[simp]
    theorem HexPolyTheory.Interpret.leadingCoeff_interpret {E : Type u} {K : Type v} [Zero E] [DecidableEq E] [Field K] [DecidableEq K] (f : E → K) (hz : ∀ (x : E), f x = 0 ↔ x = 0) (p : Hex.DensePoly E) :
    theorem HexPolyTheory.Interpret.interpret_add {E : Type u} {K : Type v} [Zero E] [DecidableEq E] [Field K] [DecidableEq K] (f : E → K) (hz : ∀ (x : E), f x = 0 ↔ x = 0) [Add E] (ha : ∀ (a b : E), f (a + b) = f a + f b) (p q : Hex.DensePoly E) :
    interpret f hz (p + q) = interpret f hz p + interpret f hz q
    theorem HexPolyTheory.Interpret.interpret_sub {E : Type u} {K : Type v} [Zero E] [DecidableEq E] [Field K] [DecidableEq K] (f : E → K) (hz : ∀ (x : E), f x = 0 ↔ x = 0) [Sub E] (hs : ∀ (a b : E), f (a - b) = f a - f b) (p q : Hex.DensePoly E) :
    interpret f hz (p - q) = interpret f hz p - interpret f hz q
    theorem HexPolyTheory.Interpret.interpret_neg {E : Type u} {K : Type v} [Zero E] [DecidableEq E] [Field K] [DecidableEq K] (f : E → K) (hz : ∀ (x : E), f x = 0 ↔ x = 0) [Sub E] (hs : ∀ (a b : E), f (a - b) = f a - f b) (p : Hex.DensePoly E) :
    interpret f hz (-p) = -interpret f hz p
    theorem HexPolyTheory.Interpret.monicize_leading {E : Type u} {K : Type v} [Zero E] [DecidableEq E] [Field K] [DecidableEq K] (f : E → K) (hz : ∀ (x : E), f x = 0 ↔ x = 0) [Mul E] [Inv E] (hm : ∀ (a b : E), f (a * b) = f a * f b) (hi : ∀ (a : E), f a⁻¹ = (f a)⁻¹) (p : Hex.DensePoly E) (hp : p ≠ 0) :

    A nonzero monicized representation has leading value one under interpretation.

    theorem HexPolyTheory.Interpret.sub_isZero {E : Type u} {K : Type v} [Zero E] [DecidableEq E] [Field K] [DecidableEq K] (f : E → K) (hz : ∀ (x : E), f x = 0 ↔ x = 0) [Sub E] (hs : ∀ (a b : E), f (a - b) = f a - f b) (p q : Hex.DensePoly E) :
    (p - q).isZero = true ↔ interpret f hz p = interpret f hz q

    A zero difference decides semantic equality, even for unequal stored polynomials.

    theorem HexPolyTheory.Interpret.interpret_mul {E : Type u} {K : Type v} [Zero E] [DecidableEq E] [Field K] [DecidableEq K] (f : E → K) (hz : ∀ (x : E), f x = 0 ↔ x = 0) [Add E] [Mul E] (ha : ∀ (a b : E), f (a + b) = f a + f b) (hm : ∀ (a b : E), f (a * b) = f a * f b) (p q : Hex.DensePoly E) :
    interpret f hz (p * q) = interpret f hz p * interpret f hz q
    theorem HexPolyTheory.Interpret.interpret_C {E : Type u} {K : Type v} [Zero E] [DecidableEq E] [Field K] [DecidableEq K] (f : E → K) (hz : ∀ (x : E), f x = 0 ↔ x = 0) (c : E) :

    Constant polynomials interpret their coefficient, including zero.

    @[simp]
    theorem HexPolyTheory.Interpret.interpret_one {E : Type u} {K : Type v} [Zero E] [DecidableEq E] [Field K] [DecidableEq K] (f : E → K) (hz : ∀ (x : E), f x = 0 ↔ x = 0) [One E] (h1 : f 1 = 1) :
    interpret f hz 1 = 1
    theorem HexPolyTheory.Interpret.interpret_scale {E : Type u} {K : Type v} [Zero E] [DecidableEq E] [Field K] [DecidableEq K] (f : E → K) (hz : ∀ (x : E), f x = 0 ↔ x = 0) [Mul E] (hm : ∀ (a b : E), f (a * b) = f a * f b) (c : E) (p : Hex.DensePoly E) :

    Scalar multiplication is interpreted coefficientwise.

    theorem HexPolyTheory.Interpret.interpret_derivative {E : Type u} {K : Type v} [Zero E] [DecidableEq E] [Field K] [DecidableEq K] (f : E → K) (hz : ∀ (x : E), f x = 0 ↔ x = 0) [NatCast E] [Mul E] (hn : ∀ (n : ℕ), f ↑n = ↑n) (hm : ∀ (a b : E), f (a * b) = f a * f b) (p : Hex.DensePoly E) :
    theorem HexPolyTheory.Interpret.eval_interpret {E : Type u} {K : Type v} [Zero E] [DecidableEq E] [Field K] [DecidableEq K] (f : E → K) (hz : ∀ (x : E), f x = 0 ↔ x = 0) [Add E] [Mul E] (ha : ∀ (a b : E), f (a + b) = f a + f b) (hm : ∀ (a b : E), f (a * b) = f a * f b) (p : Hex.DensePoly E) (x : E) :
    Polynomial.eval (f x) (interpret f hz p) = f (p.eval x)
    theorem HexPolyTheory.Interpret.interpret_rem {E : Type u} {K : Type v} [Zero E] [DecidableEq E] [Field K] [DecidableEq K] (f : E → K) (hz : ∀ (x : E), f x = 0 ↔ x = 0) [One E] [Add E] [Sub E] [Mul E] [Div E] (hs : ∀ (a b : E), f (a - b) = f a - f b) (hm : ∀ (a b : E), f (a * b) = f a * f b) (hd : ∀ (a b : E), f (a / b) = f a / f b) (p q : Hex.DensePoly E) :
    interpret f hz (p.divMod q).2 = interpret f hz p % interpret f hz q

    The interpreted remainder is Mathlib's remainder, including division by zero.

    theorem HexPolyTheory.Interpret.interpret_mod {E : Type u} {K : Type v} [Zero E] [DecidableEq E] [Field K] [DecidableEq K] (f : E → K) (hz : ∀ (x : E), f x = 0 ↔ x = 0) [One E] [Add E] [Sub E] [Mul E] [Div E] (hs : ∀ (a b : E), f (a - b) = f a - f b) (hm : ∀ (a b : E), f (a * b) = f a * f b) (hd : ∀ (a b : E), f (a / b) = f a / f b) (p q : Hex.DensePoly E) :
    interpret f hz (p % q) = interpret f hz p % interpret f hz q

    Polynomial modulus notation has the same interpreted remainder.

    theorem HexPolyTheory.Interpret.interpret_divMod {E : Type u} {K : Type v} [Zero E] [DecidableEq E] [Field K] [DecidableEq K] (f : E → K) (hz : ∀ (x : E), f x = 0 ↔ x = 0) [One E] [Add E] [Sub E] [Mul E] [Div E] (hs : ∀ (a b : E), f (a - b) = f a - f b) (hm : ∀ (a b : E), f (a * b) = f a * f b) (hd : ∀ (a b : E), f (a / b) = f a / f b) (p q : Hex.DensePoly E) :
    (interpret f hz (p.divMod q).1, interpret f hz (p.divMod q).2) = (interpret f hz p / interpret f hz q, interpret f hz p % interpret f hz q)

    Both division outputs agree with Mathlib, including a zero divisor.

    theorem HexPolyTheory.Interpret.interpret_divModMonic {E : Type u} {K : Type v} [Zero E] [DecidableEq E] [Field K] [DecidableEq K] (f : E → K) (hz : ∀ (x : E), f x = 0 ↔ x = 0) [One E] [Add E] [Sub E] [Mul E] (hs : ∀ (a b : E), f (a - b) = f a - f b) (hm : ∀ (a b : E), f (a * b) = f a * f b) (h1 : f 1 = 1) (p q : Hex.DensePoly E) (hq : q.Monic) :
    (interpret f hz (p.divModMonic q hq).1, interpret f hz (p.divModMonic q hq).2) = (interpret f hz p / interpret f hz q, interpret f hz p % interpret f hz q)

    The shared monic division corresponds to mathematical division without requiring an inverse or division operation on coefficient representatives.

    theorem HexPolyTheory.Interpret.interpret_gcd {E : Type u} {K : Type v} [Zero E] [DecidableEq E] [Field K] [DecidableEq K] (f : E → K) (hz : ∀ (x : E), f x = 0 ↔ x = 0) [One E] [Add E] [Sub E] [Mul E] [Div E] (hs : ∀ (a b : E), f (a - b) = f a - f b) (hm : ∀ (a b : E), f (a * b) = f a * f b) (hd : ∀ (a b : E), f (a / b) = f a / f b) (p q : Hex.DensePoly E) :

    The raw gcd is associated to Mathlib's normalized gcd.

    theorem HexPolyTheory.Interpret.interpret_bezout {E : Type u} {K : Type v} [Zero E] [DecidableEq E] [Field K] [DecidableEq K] (f : E → K) (hz : ∀ (x : E), f x = 0 ↔ x = 0) [One E] [Add E] [Sub E] [Mul E] [Div E] (hs : ∀ (a b : E), f (a - b) = f a - f b) (hm : ∀ (a b : E), f (a * b) = f a * f b) (hd : ∀ (a b : E), f (a / b) = f a / f b) (ha : ∀ (a b : E), f (a + b) = f a + f b) (h1 : f 1 = 1) (p q : Hex.DensePoly E) :
    interpret f hz (p.xgcd q).left * interpret f hz p + interpret f hz (p.xgcd q).right * interpret f hz q = interpret f hz (p.xgcd q).gcd

    The actual extended gcd supplies the interpreted Bézout identity.