Documentation

HexNumberField.Basic

Runtime evidence that the factorization-backed irreducibility checker accepted an integer polynomial.

  • is_true : p.isIrreducible = true

    The factorization-backed Boolean irreducibility checker accepted p.

  • pos_degree : 0 < DensePoly.natDegree p

    p has positive degree, excluding the prime constants the integer checker also accepts.

Instances
    structure Hex.PolyQuot (p : ZPoly) (x : SimpleRoot p) :

    Canonical reduced rational coordinates in the fixed field ℚ(x).

    Instances For

      A factorization-lazy algebraic root with an eagerly certified isolating representative.

      Instances For

        The fixed explicit representative of the root of X.

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

          Evidence that a representative is the deterministic representative stored by the canonical algebraic-number constructor.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            def Hex.AlgebraicNumber.rawRep? (p : ZPoly) (squarefree : HasOnlySimpleRoots p) (rep : RefinedIsolation p) (hzero : p ≠ ZPoly.X) :

            Run the deterministic representative-selection pipeline and retain its provenance together with the match against the supplied root.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              def Hex.AlgebraicNumber.rawRepIn? (p : ZPoly) (squarefree : HasOnlySimpleRoots p) (rep : RefinedIsolation p) (hzero : p ≠ ZPoly.X) (isolations : Array (DyadicRootIsolation p)) (refined : Array (RefinedIsolation p)) (hisolate : p.isolateComplexRoots? squarefree ↑(separationDepth p) = some isolations) (hrefine : Array.mapM DyadicRootIsolation.toRefined? isolations = some refined) :

              Select from an already computed deterministic isolation run. Its equations certify the provenance used by the canonical constructor; both proofs erase from compiled code.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                theorem Hex.AlgebraicNumber.rawRepIn?_eq (p : ZPoly) (squarefree : HasOnlySimpleRoots p) (rep : RefinedIsolation p) (hzero : p ≠ ZPoly.X) (isolations : Array (DyadicRootIsolation p)) (refined : Array (RefinedIsolation p)) (hisolate : p.isolateComplexRoots? squarefree ↑(separationDepth p) = some isolations) (hrefine : Array.mapM DyadicRootIsolation.toRefined? isolations = some refined) :
                rawRepIn? p squarefree rep hzero isolations refined hisolate hrefine = rawRep? p squarefree rep hzero

                Reusing a certified isolation run preserves the complete selector result.

                The real axis or one of the two open half planes.

                Instances For
                  @[instance_reducible]
                  Equations

                  An isolation with a canonical upper or real base and an orientation.

                  Instances For

                    The effective isolation of an oriented root.

                    Equations
                    Instances For

                      Reflect an oriented root without changing its base isolation.

                      Equations
                      Instances For

                        Determine the half plane of a refined isolation.

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

                          Check that the base lies in the required half plane.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            theorem Hex.AlgebraicNumber.orient?_base {p : ZPoly} {base : RefinedIsolation p} {side : RootSide} {r : OrientedIsolation p} (h : orient? base side = some r) :
                            r.base = base

                            Successful orientation preserves the base.

                            Select the canonical upper representative and restore the requested orientation.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              def Hex.AlgebraicNumber.canonicalRepIn? (p : ZPoly) (squarefree : HasOnlySimpleRoots p) (rep : RefinedIsolation p) (hzero : p ≠ ZPoly.X) (isolations : Array (DyadicRootIsolation p)) (refined : Array (RefinedIsolation p)) (hisolate : p.isolateComplexRoots? squarefree ↑(separationDepth p) = some isolations) (hrefine : Array.mapM DyadicRootIsolation.toRefined? isolations = some refined) :

                              Canonical orientation using a certified deterministic isolation run.

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                theorem Hex.AlgebraicNumber.canonicalRepIn?_eq (p : ZPoly) (squarefree : HasOnlySimpleRoots p) (rep : RefinedIsolation p) (hzero : p ≠ ZPoly.X) (isolations : Array (DyadicRootIsolation p)) (refined : Array (RefinedIsolation p)) (hisolate : p.isolateComplexRoots? squarefree ↑(separationDepth p) = some isolations) (hrefine : Array.mapM DyadicRootIsolation.toRefined? isolations = some refined) :
                                canonicalRepIn? p squarefree rep hzero isolations refined hisolate hrefine = canonicalRep? p squarefree rep hzero

                                Certified reuse preserves the orientation and canonical stored isolation.

                                A canonical algebraic number. Construction is sealed so each normalized polynomial/root pair receives one fixed representative.

                                Instances For

                                  The certified isolation of the selected complex root.

                                  Equations
                                  Instances For

                                    The half plane of the represented number.

                                    Equations
                                    Instances For

                                      Complex conjugation shares the canonical base and only changes orientation.

                                      Equations
                                      • a.conj = { p := a.p, prim := ⋯, pos_lc := ⋯, pos_degree := ⋯, checked := ⋯, squarefree := ⋯, isolation := a.isolation.conj, canonical := ⋯ }
                                      Instances For
                                        @[simp]

                                        Conjugation is an involution on the stored data.

                                        Conjugation exposes the reflected isolation without exposing the sealed constructor.

                                        @[simp]

                                        Conjugation preserves the canonical base square.

                                        @[simp]

                                        Conjugation flips precisely the two nonreal sides.

                                        Real values are fixed by conjugation.

                                        The selected simple root is determined by the canonical representative.

                                        Equations
                                        Instances For
                                          @[simp]

                                          The stored canonical representative selects exactly the root a.x.

                                          The canonical algebraic number zero, represented by the fixed explicit isolation of the normalized polynomial X.

                                          Equations
                                          Instances For

                                            The named canonical zero agrees with the Zero instance.

                                            @[simp]

                                            The canonical zero retains X as its normalized polynomial.

                                            @[simp]
                                            theorem Hex.AlgebraicNumber.zero_square :
                                            (rep 0).val.square = { re := 0, im := 0, prec := ↑(separationDepth ZPoly.X) }

                                            The canonical zero carries its explicit square centred on the real axis.

                                            @[simp]

                                            Zero lies on the real axis.

                                            Re-isolate an already normalized irreducible polynomial with the fixed default strategy and retain the unique canonical disc matching rep.

                                            The normalized polynomial X takes the explicit canonical-zero fast path, so the total Zero instance does not depend on success of a bounded driver. For all other inputs this is the implementation boundary used by later smart constructors. It is checked because failure of the bounded isolation driver is retired only by the theory companion's completeness proof.

                                            Equations
                                            • One or more equations did not get rendered due to their size.
                                            Instances For
                                              def Hex.AlgebraicNumber.ofNormalizedIn? (p : ZPoly) (prim : p.Primitive) (pos_lc : 0 < DensePoly.leadingCoeff p) (pos_degree : 0 < DensePoly.natDegree p) (checked : p.CheckedIrreducible) (squarefree : HasOnlySimpleRoots p) (rep : RefinedIsolation p) (isolations : Array (DyadicRootIsolation p)) (refined : Array (RefinedIsolation p)) (hisolate : p.isolateComplexRoots? squarefree ↑(separationDepth p) = some isolations) (hrefine : Array.mapM DyadicRootIsolation.toRefined? isolations = some refined) :

                                              Construct the identical canonical value using an isolation run already performed by the caller. The zero fast path remains explicit.

                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For
                                                theorem Hex.AlgebraicNumber.ofNormalizedIn?_eq (p : ZPoly) (prim : p.Primitive) (pos_lc : 0 < DensePoly.leadingCoeff p) (pos_degree : 0 < DensePoly.natDegree p) (checked : p.CheckedIrreducible) (squarefree : HasOnlySimpleRoots p) (rep : RefinedIsolation p) (isolations : Array (DyadicRootIsolation p)) (refined : Array (RefinedIsolation p)) (hisolate : p.isolateComplexRoots? squarefree ↑(separationDepth p) = some isolations) (hrefine : Array.mapM DyadicRootIsolation.toRefined? isolations = some refined) :
                                                ofNormalizedIn? p prim pos_lc pos_degree checked squarefree rep isolations refined hisolate hrefine = ofNormalized? p prim pos_lc pos_degree checked squarefree rep

                                                Reuse preserves the complete checked constructor result, including its canonical stored representative and every failure branch.

                                                theorem Hex.AlgebraicNumber.ofNormalized?_isSome_eq (p : ZPoly) (prim : p.Primitive) (pos_lc : 0 < DensePoly.leadingCoeff p) (pos_degree : 0 < DensePoly.natDegree p) (checked : p.CheckedIrreducible) (squarefree : HasOnlySimpleRoots p) (rep : RefinedIsolation p) :
                                                (ofNormalized? p prim pos_lc pos_degree checked squarefree rep).isSome = if _hzero : p = ZPoly.X then true else (canonicalRep? p squarefree rep _hzero).isSome

                                                The success bit of canonicalization is exactly the success bit of its isolation, refinement, and representative-selection pipeline. This exposes the checked boundary needed by the Mathlib totality proof without exposing the sealed AlgebraicNumber constructor.

                                                theorem Hex.AlgebraicNumber.ofNormalized?_p (p : ZPoly) (prim : p.Primitive) (pos_lc : 0 < DensePoly.leadingCoeff p) (pos_degree : 0 < DensePoly.natDegree p) (checked : p.CheckedIrreducible) (squarefree : HasOnlySimpleRoots p) (rep : RefinedIsolation p) {a : AlgebraicNumber} (h : ofNormalized? p prim pos_lc pos_degree checked squarefree rep = some a) :
                                                a.p = p

                                                Successful canonicalization retains the supplied normalized polynomial.

                                                Canonicality is preserved when the defining polynomial is identified.

                                                def Hex.AlgebraicNumber.ofNormalized (p : ZPoly) (prim : p.Primitive) (pos_lc : 0 < DensePoly.leadingCoeff p) (pos_degree : 0 < DensePoly.natDegree p) (checked : p.CheckedIrreducible) (squarefree : HasOnlySimpleRoots p) (rep : RefinedIsolation p) (h : (ofNormalized? p prim pos_lc pos_degree checked squarefree rep).isSome = true) :

                                                The checked total constructor retains the defining polynomial as literal data. Its root is the same canonical root returned by ofNormalized?; reading the polynomial does not replay the isolation pipeline.

                                                Equations
                                                • One or more equations did not get rendered due to their size.
                                                Instances For
                                                  @[simp]
                                                  theorem Hex.AlgebraicNumber.ofNormalized_p (p : ZPoly) (prim : p.Primitive) (pos_lc : 0 < DensePoly.leadingCoeff p) (pos_degree : 0 < DensePoly.natDegree p) (checked : p.CheckedIrreducible) (squarefree : HasOnlySimpleRoots p) (rep : RefinedIsolation p) (h : (ofNormalized? p prim pos_lc pos_degree checked squarefree rep).isSome = true) :
                                                  (ofNormalized p prim pos_lc pos_degree checked squarefree rep h).p = p
                                                  theorem Hex.AlgebraicNumber.ofNormalized?_spec (p : ZPoly) (prim : p.Primitive) (pos_lc : 0 < DensePoly.leadingCoeff p) (pos_degree : 0 < DensePoly.natDegree p) (checked : p.CheckedIrreducible) (squarefree : HasOnlySimpleRoots p) (rep : RefinedIsolation p) {a : AlgebraicNumber} (h : ofNormalized? p prim pos_lc pos_degree checked squarefree rep = some a) :
                                                  p = ZPoly.X ∧ a = 0 ∨ ∃ (hp : a.p = p), Intersects (hp ▸ a.rep) rep

                                                  A successful canonicalization either takes the explicit zero path or stores a representative intersecting the supplied isolation. This is the Mathlib-free behavioral boundary used by semantic soundness proofs.

                                                  theorem Hex.AlgebraicNumber.ext (a b : AlgebraicNumber) (hp : a.p = b.p) (hisolation : a.isolation ≍ b.isolation) :
                                                  a = b

                                                  Two canonical values are equal once their dependent polynomials and stored representatives agree. The remaining fields are propositions, and the selected SimpleRoot is forced by rep_mk.

                                                  Closed-disc membership test for zero, including boundary contact.

                                                  Equations
                                                  Instances For

                                                    Canonical equality: compare minimal polynomials, then the selected roots.

                                                    Equations
                                                    Instances For

                                                      A canonical algebraic number is zero exactly when its minimal polynomial is X.

                                                      Equations
                                                      Instances For

                                                        The selected lazy root is zero exactly when its polynomial has zero constant coefficient and its closed isolating disc contains zero. The refined separation bound makes this test decisive between distinct simple roots.

                                                        Equations
                                                        Instances For
                                                          def Hex.panicWith {α : Sort u_1} (fallback : α) (message : String) :
                                                          α

                                                          Print a diagnostic in compiled code and return the supplied fallback.

                                                          Equations
                                                          Instances For
                                                            structure Hex.RootCount :

                                                            A root paired with its positive multiplicity.

                                                            • The recorded root.

                                                            • multiplicity : Nat

                                                              The multiplicity of the root in the polynomial being solved.

                                                            • multiplicity_pos : 0 < self.multiplicity

                                                              Roots are recorded only with positive multiplicity.

                                                            Instances For
                                                              inductive Hex.RootSet :

                                                              A polynomial root set; .all is reserved for the zero polynomial.

                                                              Instances For

                                                                The recorded roots of a nonzero polynomial, or none for the zero polynomial, every number being a root of that.

                                                                Equations
                                                                Instances For

                                                                  The recorded roots, with the zero polynomial giving the empty array.

                                                                  Equations
                                                                  Instances For
                                                                    @[simp]
                                                                    theorem Hex.RootSet.finite?_finite (roots : Array RootCount) :
                                                                    (finite roots).finite? = some roots
                                                                    @[simp]
                                                                    theorem Hex.RootSet.toArray_finite (roots : Array RootCount) :
                                                                    (finite roots).toArray = roots