Documentation

HexNumberField.Convert

The minimal polynomial of a canonical algebraic number carries checked irreducibility, so PolyQuot a.p a.x has inversion and division without the evidence being registered by hand.

@[implicit_reducible]

The fixed field ℚ(a) of a canonical algebraic number: the presentation ring on its minimal polynomial, with the embedding fixed by the root it denotes. Reducible, so every PolyQuot operation, instance and theorem applies unchanged.

Equations
Instances For
    @[instance_reducible]
    Equations
    @[instance_reducible]
    Equations
    @[instance_reducible]
    Equations
    @[instance_reducible]
    Equations
    @[instance_reducible]
    Equations
    @[instance_reducible]
    Equations
    @[instance_reducible, instance 90]
    Equations
    @[instance_reducible]
    Equations
    @[instance_reducible]
    Equations

    The element of ℚ(a) with coordinates f in the power basis of a. Unlike PolyQuot.ofSquare this needs no square and no side conditions: the generating number already carries its own root.

    Equations
    Instances For

      The canonical algebraic number as the generator of its own fixed field.

      Equations
      Instances For

        Forget minimality while retaining every checked root certificate.

        Equations
        • a.toRoot = { p := a.p, prim := ⋯, pos_lc := ⋯, pos_degree := ⋯, squarefree := ⋯, x := a.x, rep := a.rep, rep_mk := ⋯ }
        Instances For

          Try one normalized factor of a lazy root's enclosing polynomial. Candidate isolations are refined to the enclosing polynomial's separation precision before their discs are compared.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            theorem Hex.AlgebraicRoot.exactFactor?_eq (a : AlgebraicRoot) (q : ZPoly) :
            a.exactFactor? q = if hprim : q.content = 1 then if hpos : 0 < DensePoly.leadingCoeff q then if hdegree : 0 < DensePoly.natDegree q then if hirred : q.isIrreducible = true then if hsquarefree : HasOnlySimpleRoots q then do let isolations ← q.isolateComplexRoots? hsquarefree ↑(separationDepth q) let refined ← Array.mapM DyadicRootIsolation.toRefined? isolations let comparable ← Array.mapM (fun (r : RefinedIsolation q) => (r.refineTo? ↑(mahlerPrec a.p)).unattach) refined let matching ← List.find? (fun (r : RefinedIsolation q) => decide (↑(mahlerPrec a.p) ≤ r.val.square.prec) && r.val.square.discsMeet a.rep.val.square) comparable.toList AlgebraicNumber.ofNormalized? q hprim hpos hdegree ⋯ hsquarefree matching else none else none else none else none else none

            Certified isolation reuse preserves the original exactification pipeline, including its canonical stored representative and all checked failures.

            Factor a lazy root's enclosing polynomial and select the normalized irreducible factor containing its chosen root. none is a checked implementation branch whose unreachability is proved by the Mathlib companion.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              def Hex.AlgebraicRoot.exactParent? (a : AlgebraicRoot) (isolations : Array (DyadicRootIsolation a.p)) (refined : Array (RefinedIsolation a.p)) (hisolate : a.p.isolateComplexRoots? ⋯ ↑(separationDepth a.p) = some isolations) (hrefine : Array.mapM DyadicRootIsolation.toRefined? isolations = some refined) :

              Exactify the enclosing polynomial using a certified isolation run already computed by its producer. Reducible enclosing polynomials are rejected here.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                theorem Hex.AlgebraicRoot.exactParent?_eq (a : AlgebraicRoot) (isolations : Array (DyadicRootIsolation a.p)) (refined : Array (RefinedIsolation a.p)) (hisolate : a.p.isolateComplexRoots? ⋯ ↑(separationDepth a.p) = some isolations) (hrefine : Array.mapM DyadicRootIsolation.toRefined? isolations = some refined) :
                a.exactParent? isolations refined hisolate hrefine = a.exactFactor? a.p

                Reusing the parent run preserves the complete factor selector result.

                def Hex.AlgebraicRoot.exactIn? (a : AlgebraicRoot) (isolations : Array (DyadicRootIsolation a.p)) (refined : Array (RefinedIsolation a.p)) (hisolate : a.p.isolateComplexRoots? ⋯ ↑(separationDepth a.p) = some isolations) (hrefine : Array.mapM DyadicRootIsolation.toRefined? isolations = some refined) :

                Exactification reusing the enclosing polynomial's certified isolation when a returned factor is that polynomial. Proper factors use their own runs.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  theorem Hex.AlgebraicRoot.exactIn?_eq (a : AlgebraicRoot) (isolations : Array (DyadicRootIsolation a.p)) (refined : Array (RefinedIsolation a.p)) (hisolate : a.p.isolateComplexRoots? ⋯ ↑(separationDepth a.p) = some isolations) (hrefine : Array.mapM DyadicRootIsolation.toRefined? isolations = some refined) :
                  a.exactIn? isolations refined hisolate hrefine = a.exact?

                  Parent isolation reuse changes neither canonical representatives nor checked failures of exactification, including reducible enclosing polynomials.

                  Canonicalize a lazy root: the total form of exact?, whose none branch the theory companion proves unreachable.

                  Equations
                  Instances For
                    def Hex.PolyQuot.krylovPowers {p : ZPoly} {x : SimpleRoot p} (a : PolyQuot p x) (n : Nat) :
                    Vector (PolyQuot p x) (n + 1)

                    The first n + 1 Krylov powers, built with one multiplication per step.

                    Equations
                    Instances For

                      Krylov orbit 1, a, a², ... through the defining-field dimension.

                      Equations
                      Instances For

                        The monic polynomial encoded by a Krylov dependence vector.

                        Equations
                        Instances For

                          The monic relation at one Krylov-orbit index, when the new power is in the span of its predecessors.

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

                            First monic relation in the Krylov orbit of the multiplication operator, normalized as a primitive positive-leading integer polynomial.

                            Equations
                            Instances For

                              Convert a fixed-presentation value to its canonical irreducible representation. Every stored certificate and every precision-sensitive step is checked before construction.

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                theorem Hex.PolyQuot.toAlgebraicNumber?_eq {p : ZPoly} {x : SimpleRoot p} [p.CheckedIrreducible] (a : PolyQuot p x) (rep : RefinedIsolation p) (h : SimpleRoot.mk rep = x) :
                                a.toAlgebraicNumber? rep h = do let q ← a.minpoly? if hprim : q.content = 1 then if hpos : 0 < DensePoly.leadingCoeff q then if hdegree : 0 < DensePoly.natDegree q then if hirred : q.isIrreducible = true then if hsquarefree : HasOnlySimpleRoots q then do let isolations ← q.isolateComplexRoots? hsquarefree ↑(separationDepth q) let refined ← Array.mapM DyadicRootIsolation.toRefined? isolations have requested : Int := ↑(mahlerPrec q) have target : Int := requested + ↑(approxGuardBits rep.val.square a.coeffs) let threaded ← rep.refineTo? target have valueBall : DyadicComplexBall := evalRatBall a.coeffs threaded.val.val.square target let matching ← List.find? (fun (r : RefinedIsolation q) => r.val.square.meetsBall valueBall) refined.toList AlgebraicNumber.ofNormalized? q hprim hpos hdegree ⋯ hsquarefree matching else none else none else none else none else none

                                Reusing the certified isolation run preserves the complete canonical conversion result, including every stored representative and checked failure.

                                Total fixed-presentation conversion. The checked failure branch is proved unreachable by the theory companion.

                                Equations
                                Instances For

                                  The canonical number an element of ℚ(a) denotes, or none if the certification failed. The general form applied with a's own representative.

                                  Equations
                                  Instances For

                                    The canonical number an element of ℚ(a) denotes.

                                    Equations
                                    Instances For