Documentation

HexBerlekampZassenhausMathlib.BadVector

A positive-degree CLD divisor leaves a quotient with strictly fewer coefficient slots than the input. Thus the production coeffWidth = deg(f) array stores the whole CLD quotient, not a truncation.

The full centred CLD-residue combination attached to the first block of a BHKS vector.

Equations
Instances For

    Correct reconstruction of one coefficient of the truncated-lattice auxiliary polynomial from the full lattice vector.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      Polynomial whose coefficients are the full centred CLD-residue combination POL(e).

      Equations
      Instances For

        Polynomial reconstructed from all coordinates of a truncated BHKS lattice vector.

        Equations
        Instances For
          @[simp]

          Coefficient rule for pol.

          theorem HexBerlekampZassenhausMathlib.BHKS.fullAuxCoeff_vecMul (L : Hex.BhksLatticeBasis) (hL : BhksBlockForm L) (z : Fin L.factorCountFin L.coeffWidth) (c : Vector (L.factorCount + L.coeffWidth)) (j : Fin L.coeffWidth) (hcut : L.cutThresholds.getD (↑j) 0 L.precision) (hp : 0 < L.p) (hcld : ∀ (i : Fin L.factorCount), (L.cldRows.getD i #[]).getD (↑j) 0 = Hex.psiCut L.p L.precision (L.cutThresholds.getD (↑j) 0) (z i j)) :

          The corrected coefficient reconstruction identity.

          The top-right block contributes the cut coefficients, the bottom-right block contributes the period coefficient, and the low residues restore the discarded part of each centred CLD residue. The only term left over is the displayed multiple of p^precision.

          theorem HexBerlekampZassenhausMathlib.BHKS.fullAux_congr_pol_vecMul (L : Hex.BhksLatticeBasis) (hL : BhksBlockForm L) (z : Fin L.factorCountFin L.coeffWidth) (c : Vector (L.factorCount + L.coeffWidth)) (hcut : ∀ (j : Fin L.coeffWidth), L.cutThresholds.getD (↑j) 0 L.precision) (hp : 0 < L.p) (hcld : ∀ (i : Fin L.factorCount) (j : Fin L.coeffWidth), (L.cldRows.getD i #[]).getD (↑j) 0 = Hex.psiCut L.p L.precision (L.cutThresholds.getD (↑j) 0) (z i j)) :

          Polynomial form of fullAuxCoeff_vecMul: the full-vector auxiliary is coefficientwise congruent modulo p^precision to POL(e).

          def HexBerlekampZassenhausMathlib.BHKS.cldResidue (f : Hex.ZPoly) (p a : ) (liftedFactors : Array Hex.ZPoly) (i : Fin (Hex.bhksLatticeBasis f p a liftedFactors).factorCount) (j : Fin (Hex.bhksLatticeBasis f p a liftedFactors).coeffWidth) :

          Raw quotient coefficient used by the production all-coefficients CLD lattice.

          Equations
          Instances For
            def HexBerlekampZassenhausMathlib.BHKS.cldFullAux (f : Hex.ZPoly) (p a : ) (liftedFactors : Array Hex.ZPoly) (v : Vector ((Hex.bhksLatticeBasis f p a liftedFactors).factorCount + (Hex.bhksLatticeBasis f p a liftedFactors).coeffWidth)) :

            Production specialization of the corrected full-vector auxiliary.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              theorem HexBerlekampZassenhausMathlib.BHKS.cldFullAux_coeff_natAbs_le (f : Hex.ZPoly) (p a : ) (liftedFactors : Array Hex.ZPoly) (v : Vector ((Hex.bhksLatticeBasis f p a liftedFactors).factorCount + (Hex.bhksLatticeBasis f p a liftedFactors).coeffWidth)) (E : ) (hp2 : 2 p) (hp500 : p 500) (hr : liftedFactors.size Hex.DensePoly.natDegree f) (hv : ∀ (x : Fin (liftedFactors.size + Hex.DensePoly.natDegree f)), v[x].natAbs E) (k : ) :
              (Hex.DensePoly.coeff (cldFullAux f p a liftedFactors v) k).natAbs (Hex.DensePoly.natDegree f + 1) * E * (500 * (Hex.bhksColumnFloor f + 1))

              Every coefficient of the corrected production auxiliary is bounded by the M component of Hex.bhksBound, provided all coordinates of the full lattice vector have magnitude at most E.

              The period coordinate contributes one term bounded by E*C; each of the at most degree f first-block coordinates contributes another such term.

              The corrected full auxiliary stores exactly degree f coefficient slots.

              def HexBerlekampZassenhausMathlib.BHKS.cldPol (f : Hex.ZPoly) (p a : ) (liftedFactors : Array Hex.ZPoly) (v : Vector ((Hex.bhksLatticeBasis f p a liftedFactors).factorCount + (Hex.bhksLatticeBasis f p a liftedFactors).coeffWidth)) :

              Production specialization of the full centred residue combination POL(e).

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                noncomputable def HexBerlekampZassenhausMathlib.BHKS.cldCombination (f : Hex.ZPoly) (p a : ) (liftedFactors : Array Hex.ZPoly) (v : Vector ((Hex.bhksLatticeBasis f p a liftedFactors).factorCount + (Hex.bhksLatticeBasis f p a liftedFactors).coeffWidth)) :

                The same production CLD combination before coefficient centering.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  theorem HexBerlekampZassenhausMathlib.BHKS.cldCombination_coeff (f : Hex.ZPoly) (p a : ) (liftedFactors : Array Hex.ZPoly) (v : Vector ((Hex.bhksLatticeBasis f p a liftedFactors).factorCount + (Hex.bhksLatticeBasis f p a liftedFactors).coeffWidth)) (j : ) :
                  (cldCombination f p a liftedFactors v).coeff j = i : Fin liftedFactors.size, v[Fin.castAdd (Hex.DensePoly.natDegree f) i] * Hex.DensePoly.coeff (Hex.cldQuotientMod f (liftedFactors.getD (↑i) 1) p a) j

                  Coefficients of the uncentred CLD combination.

                  theorem HexBerlekampZassenhausMathlib.BHKS.cldPol_coeff_of_lt (f : Hex.ZPoly) (p a : ) (liftedFactors : Array Hex.ZPoly) (v : Vector ((Hex.bhksLatticeBasis f p a liftedFactors).factorCount + (Hex.bhksLatticeBasis f p a liftedFactors).coeffWidth)) (k : ) (hk : k < Hex.DensePoly.natDegree f) :
                  Hex.DensePoly.coeff (cldPol f p a liftedFactors v) k = i : Fin liftedFactors.size, v[Fin.castAdd (Hex.DensePoly.natDegree f) i] * Hex.centeredResiduePow p a (Hex.DensePoly.coeff (Hex.cldQuotientMod f (liftedFactors.getD (↑i) 1) p a) k)

                  In-range coefficient formula for the centred production CLD combination.

                  theorem HexBerlekampZassenhausMathlib.BHKS.cldPol_map_eq_cldCombination (f : Hex.ZPoly) (p a : ) (liftedFactors : Array Hex.ZPoly) (v : Vector ((Hex.bhksLatticeBasis f p a liftedFactors).factorCount + (Hex.bhksLatticeBasis f p a liftedFactors).coeffWidth)) (hf : 0 < Hex.DensePoly.natDegree f) (hdeg : ∀ (i : Fin liftedFactors.size), 0 < Hex.DensePoly.natDegree (liftedFactors.getD (↑i) 1)) :
                  Polynomial.map (Int.castRingHom (ZMod (p ^ a))) (HexPolyZMathlib.toPolynomial (cldPol f p a liftedFactors v)) = Polynomial.map (Int.castRingHom (ZMod (p ^ a))) (cldCombination f p a liftedFactors v)

                  Modulo the lift modulus, centering the stored CLD coefficients does not change the polynomial combination.

                  theorem HexBerlekampZassenhausMathlib.BHKS.liftedFactor_dvd_cldCombination_of_coord_eq_zero (f : Hex.ZPoly) (p a : ) (liftedFactors : Array Hex.ZPoly) (v : Vector ((Hex.bhksLatticeBasis f p a liftedFactors).factorCount + (Hex.bhksLatticeBasis f p a liftedFactors).coeffWidth)) (i₀ : Fin liftedFactors.size) (hk : 1 < p ^ a) (hfac : ∀ (i : Fin liftedFactors.size), ∃ (h : Hex.ZPoly), Hex.DensePoly.Monic (liftedFactors.getD (↑i) 1) 0 < Hex.DensePoly.natDegree (liftedFactors.getD (↑i) 1) f.congr (liftedFactors.getD (↑i) 1 * h) (p ^ a)) (hcop : ∀ (j : Fin liftedFactors.size), j i₀IsCoprime (Polynomial.map (Int.castRingHom (ZMod (p ^ a))) (HexPolyZMathlib.toPolynomial (liftedFactors.getD (↑i₀) 1))) (Polynomial.map (Int.castRingHom (ZMod (p ^ a))) (HexPolyZMathlib.toPolynomial (liftedFactors.getD (↑j) 1)))) (hzero : v[Fin.castAdd (Hex.DensePoly.natDegree f) i₀] = 0) :
                  Polynomial.map (Int.castRingHom (ZMod (p ^ a))) (HexPolyZMathlib.toPolynomial (liftedFactors.getD (↑i₀) 1)) Polynomial.map (Int.castRingHom (ZMod (p ^ a))) (cldCombination f p a liftedFactors v)

                  If one first-block exponent is zero, the corresponding lifted local factor divides the uncentred CLD combination modulo the lift modulus. Pairwise coprimality cancels every other lifted factor from its CLD syzygy.

                  theorem HexBerlekampZassenhausMathlib.BHKS.coord_cast_eq_zero_of_liftedFactor_dvd_cldCombination (f : Hex.ZPoly) (p a : ) (liftedFactors : Array Hex.ZPoly) (v : Vector ((Hex.bhksLatticeBasis f p a liftedFactors).factorCount + (Hex.bhksLatticeBasis f p a liftedFactors).coeffWidth)) (i₀ : Fin liftedFactors.size) (hk : 1 < p ^ a) (hfac : ∀ (i : Fin liftedFactors.size), ∃ (h : Hex.ZPoly), Hex.DensePoly.Monic (liftedFactors.getD (↑i) 1) 0 < Hex.DensePoly.natDegree (liftedFactors.getD (↑i) 1) f.congr (liftedFactors.getD (↑i) 1 * h) (p ^ a)) (hcop : ∀ (j : Fin liftedFactors.size), j i₀IsCoprime (Polynomial.map (Int.castRingHom (ZMod (p ^ a))) (HexPolyZMathlib.toPolynomial (liftedFactors.getD (↑i₀) 1))) (Polynomial.map (Int.castRingHom (ZMod (p ^ a))) (HexPolyZMathlib.toPolynomial (liftedFactors.getD (↑j) 1)))) (hown : IsCoprime (Polynomial.map (Int.castRingHom (ZMod (p ^ a))) (HexPolyZMathlib.toPolynomial (liftedFactors.getD (↑i₀) 1))) (Polynomial.map (Int.castRingHom (ZMod (p ^ a))) (HexPolyZMathlib.toPolynomial (Hex.cldQuotientMod f (liftedFactors.getD (↑i₀) 1) p a)))) (hdvd : Polynomial.map (Int.castRingHom (ZMod (p ^ a))) (HexPolyZMathlib.toPolynomial (liftedFactors.getD (↑i₀) 1)) Polynomial.map (Int.castRingHom (ZMod (p ^ a))) (cldCombination f p a liftedFactors v)) :

                  Conversely, if a lifted factor divides the CLD combination and is coprime to its own CLD quotient modulo the lift modulus, then its first-block exponent vanishes modulo that modulus.

                  The CLD quotient belonging to one lifted factor is coprime to that factor modulo the lift modulus. The two substantive inputs are exactly the familiar square-free factorisation properties: the factor is coprime to its complementary factor h, and it is coprime to its own derivative.

                  Indeed the CLD congruence and f ≡ q * h give q * cld = q * (h * q') after mapping modulo p^a. Monicity cancels q; the right-hand side is coprime to q.

                  theorem HexBerlekampZassenhausMathlib.BHKS.cldFullAux_congr_cldPol (f : Hex.ZPoly) (p a : ) (liftedFactors : Array Hex.ZPoly) (c : Vector ((Hex.bhksLatticeBasis f p a liftedFactors).factorCount + (Hex.bhksLatticeBasis f p a liftedFactors).coeffWidth)) (hp : 0 < p) (hcut : ∀ (j : Fin (Hex.DensePoly.natDegree f)), Hex.bhksCoeffCutThreshold p f j a) :
                  (cldFullAux f p a liftedFactors (Hex.Matrix.vecMul c (Hex.bhksLatticeBasis f p a liftedFactors).basis)).congr (cldPol f p a liftedFactors (Hex.Matrix.vecMul c (Hex.bhksLatticeBasis f p a liftedFactors).basis)) (p ^ a)

                  The corrected auxiliary polynomial for the production BHKS basis is congruent to its full centred CLD-residue combination modulo p^a.

                  theorem HexBerlekampZassenhausMathlib.BHKS.liftedFactor_dvd_cldFullAux (f : Hex.ZPoly) (p a : ) (liftedFactors : Array Hex.ZPoly) (v : Vector ((Hex.bhksLatticeBasis f p a liftedFactors).factorCount + (Hex.bhksLatticeBasis f p a liftedFactors).coeffWidth)) (i₀ : Fin liftedFactors.size) (hf : 0 < Hex.DensePoly.natDegree f) (hk : 1 < p ^ a) (hp : 0 < p) (hcut : ∀ (j : Fin (Hex.DensePoly.natDegree f)), Hex.bhksCoeffCutThreshold p f j a) (hfac : ∀ (i : Fin liftedFactors.size), ∃ (h : Hex.ZPoly), Hex.DensePoly.Monic (liftedFactors.getD (↑i) 1) 0 < Hex.DensePoly.natDegree (liftedFactors.getD (↑i) 1) f.congr (liftedFactors.getD (↑i) 1 * h) (p ^ a)) (hcop : ∀ (j : Fin liftedFactors.size), j i₀IsCoprime (Polynomial.map (Int.castRingHom (ZMod (p ^ a))) (HexPolyZMathlib.toPolynomial (liftedFactors.getD (↑i₀) 1))) (Polynomial.map (Int.castRingHom (ZMod (p ^ a))) (HexPolyZMathlib.toPolynomial (liftedFactors.getD (↑j) 1)))) (hv : (Hex.bhksLatticeBasis f p a liftedFactors).basis.memLattice v) (hzero : v[Fin.castAdd (Hex.DensePoly.natDegree f) i₀] = 0) :

                  A zero first-block coordinate of an actual BHKS lattice vector makes the corresponding lifted factor divide the corrected full auxiliary modulo the lift modulus.

                  theorem HexBerlekampZassenhausMathlib.BHKS.coord_cast_eq_zero_of_liftedFactor_dvd_cldFullAux (f : Hex.ZPoly) (p a : ) (liftedFactors : Array Hex.ZPoly) (v : Vector ((Hex.bhksLatticeBasis f p a liftedFactors).factorCount + (Hex.bhksLatticeBasis f p a liftedFactors).coeffWidth)) (i₀ : Fin liftedFactors.size) (hf : 0 < Hex.DensePoly.natDegree f) (hk : 1 < p ^ a) (hp : 0 < p) (hcut : ∀ (j : Fin (Hex.DensePoly.natDegree f)), Hex.bhksCoeffCutThreshold p f j a) (hfac : ∀ (i : Fin liftedFactors.size), ∃ (h : Hex.ZPoly), Hex.DensePoly.Monic (liftedFactors.getD (↑i) 1) 0 < Hex.DensePoly.natDegree (liftedFactors.getD (↑i) 1) f.congr (liftedFactors.getD (↑i) 1 * h) (p ^ a)) (hcop : ∀ (j : Fin liftedFactors.size), j i₀IsCoprime (Polynomial.map (Int.castRingHom (ZMod (p ^ a))) (HexPolyZMathlib.toPolynomial (liftedFactors.getD (↑i₀) 1))) (Polynomial.map (Int.castRingHom (ZMod (p ^ a))) (HexPolyZMathlib.toPolynomial (liftedFactors.getD (↑j) 1)))) (hown : IsCoprime (Polynomial.map (Int.castRingHom (ZMod (p ^ a))) (HexPolyZMathlib.toPolynomial (liftedFactors.getD (↑i₀) 1))) (Polynomial.map (Int.castRingHom (ZMod (p ^ a))) (HexPolyZMathlib.toPolynomial (Hex.cldQuotientMod f (liftedFactors.getD (↑i₀) 1) p a)))) (hv : (Hex.bhksLatticeBasis f p a liftedFactors).basis.memLattice v) (hdvd : Polynomial.map (Int.castRingHom (ZMod (p ^ a))) (HexPolyZMathlib.toPolynomial (liftedFactors.getD (↑i₀) 1)) Polynomial.map (Int.castRingHom (ZMod (p ^ a))) (HexPolyZMathlib.toPolynomial (cldFullAux f p a liftedFactors v))) :

                  Divisibility of the corrected full auxiliary by a lifted factor forces the corresponding first-block coordinate to vanish modulo the lift modulus.