Documentation

CompPoly.Multilinear.Equiv

Equivalence between CMlPolynomial and multilinear polynomials in MvPolynomial #

This file establishes the mathematical foundations for CMlPolynomial by proving:

  1. Basis properties for the coefficient representation
  2. Change-of-basis matrices between different representations
  3. Equivalences with mathlib's MvPolynomial.restrictDegree: equivMvPolynomialDeg1
  4. Arithmetic operation compatibilities

Equivalence with Mathlib MvPolynomial #

noncomputable def CompPoly.CMlPolynomial.monomialOfNat {n : } (i : ) :

Converts a natural number to a monomial with 0/1 exponents. Uses little‑endian bit encoding: bit 0 is the least significant bit. The exponent at variable j is Nat.getBit j i ∈ {0,1}.

Instances For
    theorem CompPoly.CMlPolynomial.eq_monomialOfNat_iff_eq_bitRepr {n : } (m : Fin n →₀ ) (h_binary : ∀ (j : Fin n), m j 1) (i : Fin (2 ^ n)) :
    monomialOfNat i = m i = Nat.binaryFinMapToNat (⇑m) h_binary
    noncomputable def CompPoly.CMlPolynomial.toMvPolynomial {R : Type u_1} [CommSemiring R] {n : } (p : CMlPolynomial R n) :

    Converts an CMlPolynomial to a mathlib multivariate polynomial. Sums over all indices i : Fin (2^n) with monomial exponents from monomialOfNat i and coefficients p[i].

    Instances For
      theorem CompPoly.CMlPolynomial.coeff_of_toMvPolynomial_eq_coeff_of_CMlPolynomial {R : Type u_1} [CommSemiring R] {n : } (p : CMlPolynomial R n) (m : Fin n →₀ ) :
      MvPolynomial.coeff m p.toMvPolynomial = if h_binary : ∀ (j : Fin n), m j 1 then let i_of_m := (Nat.binaryFinMapToNat (⇑m) h_binary); p[i_of_m] else 0

      Converts an CMlPolynomial to a mathlib restricted-degree multivariate polynomial. Wraps toMvPolynomial with a proof that the result is multilinear (i.e. individual degrees ≤ 1).

      Instances For

        Converts a mathlib restricted-degree multivariate polynomial to an CMlPolynomial. Extracts coefficients using monomialOfNat to map indices to monomials.

        Instances For

          Equivalence between CMlPolynomial and mathlib's restricted-degree multivariate polynomials. Establishes that both representations are isomorphic via coefficient extraction/insertion.

          Instances For

            Linear equivalence between CMlPolynomial and MvPolynomial.restrictDegree

            Instances For

              Converts a hypercube-evaluation representation to a Mathlib multivariate polynomial by first recovering the monomial-basis representation.

              Instances For

                Converts a hypercube-evaluation representation to a Mathlib restricted-degree multivariate polynomial.

                Instances For
                  noncomputable def CompPoly.CMlPolynomialEval.eqPolynomial {R : Type u_1} [CommSemiring R] {n : } [CommRing R] (w : Vector R n) :

                  The multilinear equality polynomial centered at w.

                  Instances For
                    noncomputable def CompPoly.CMlPolynomialEval.eqPolynomialDeg1 {R : Type u_1} [CommSemiring R] {n : } [CommRing R] (w : Vector R n) :

                    The restricted-degree multilinear equality polynomial centered at w.

                    Instances For