Documentation

HexRealRoots.Tarski

inductive Hex.Endpoint (E : Type u) :

An exact endpoint, including both infinities.

Instances For
    structure Hex.EndpointSigns (D : Type u) (E : Type v) [Zero D] [DecidableEq D] :
    Type (max u v)

    Exact finite comparison and evaluation signs. Endpoint values may belong to an ordered extension of the coefficient domain, as for integer/dyadic queries.

    Instances For
      def Hex.EndpointSigns.ofSign {E : Type u} [Zero E] [DecidableEq E] [Sub E] [Add E] [Mul E] (sign : E → Int) :

      Compare and evaluate finite endpoints using a supplied coefficient sign.

      Equations
      Instances For
        def Hex.Endpoint.lt {D : Type u_1} {E : Type u_2} [Zero D] [DecidableEq D] (endpointSigns : EndpointSigns D E) :
        Endpoint E → Endpoint E → Bool
        Equations
        Instances For
          def Hex.Endpoint.signAt {D : Type u_1} {E : Type u_2} [Zero D] [DecidableEq D] (sign : D → Int) (endpointSigns : EndpointSigns D E) (p : DensePoly D) :
          Equations
          Instances For
            def Hex.Endpoint.nonvanishing {D : Type u_1} {E : Type u_2} [Zero D] [DecidableEq D] (endpointSigns : EndpointSigns D E) (p : DensePoly D) :
            Equations
            Instances For
              structure Hex.TarskiCertificate (D : Type u) (E : Type v) (Ctx : Type w) [Zero D] [DecidableEq D] :
              Type (max (max u v) w)

              Literal inputs/context and finite query evidence. Ctx is the caller's full literal context data, not a hash. A derivative-chain replay proves the squarefree guard without running a gcd search in the checker.

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

                A nonzero constant terminal gcd is the squarefree criterion; its stored leading coefficient need not be literal one.

                Equations
                Instances For
                  def Hex.TarskiCertificate.signs {D : Type u} {E : Type v} [Zero D] [DecidableEq D] (sign : D → Int) (endpointSigns : EndpointSigns D E) (chain : Array (DensePoly D)) (endpoint : Endpoint E) :

                  Exact signs of a literal chain at a finite or infinite endpoint.

                  Equations
                  Instances For
                    def Hex.TarskiCertificate.checkEndpoints {D : Type u} {E : Type v} [Zero D] [DecidableEq D] (endpointSigns : EndpointSigns D E) (p : DensePoly D) (a b : Endpoint E) :

                    Nonzero input, strictly ordered endpoints and finite endpoint nonvanishing. These guards precede all constant and zero-query shortcuts.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      def Hex.TarskiCertificate.fromChains {D : Type u} {E : Type v} {Ctx : Type w} [Zero D] [DecidableEq D] (sign : D → Int) (endpointSigns : EndpointSigns D E) (context : Ctx) (p f : DensePoly D) (a b : Endpoint E) (squarefree remainders : SignedRemainderChain D) :

                      Attach exact endpoint signs and variations to supplied producer chains. This is shared by ordinary and prepared-domain frontends.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        def Hex.TarskiCertificate.certify {D : Type u} {E : Type v} {Ctx : Type w} [Zero D] [DecidableEq D] [One D] [Add D] [Sub D] [Mul D] [NatCast D] [Neg D] (sign : D → Int) (endpointSigns : EndpointSigns D E) (normalize : DensePoly D → D × DensePoly D) (context : Ctx) (p f : DensePoly D) (a b : Endpoint E) :

                        Produce a finite query certificate using the one shared signed-remainder kernel. The normalizer is a total positive-content backend; field callers may use SignedRemainderChain.normalizeId. No root search or isolation is performed.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          def Hex.TarskiCertificate.query {D : Type u} {E : Type v} [Zero D] [DecidableEq D] [One D] [Add D] [Sub D] [Mul D] [NatCast D] [Neg D] (sign : D → Int) (endpointSigns : EndpointSigns D E) (normalize : DensePoly D → D × DensePoly D) (p f : DensePoly D) (a b : Endpoint E) :

                          The query value of the shared producer. Negative values are retained.

                          Equations
                          Instances For
                            def Hex.TarskiCertificate.checkBindings {D : Type u} {E : Type v} {Ctx : Type w} [Zero D] [DecidableEq D] [DecidableEq E] [DecidableEq Ctx] (context : Ctx) (p f : DensePoly D) (a b : Endpoint E) (value : Int) (cert : TarskiCertificate D E Ctx) :

                            Bind every literal query input and claimed value before checking evidence.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              def Hex.TarskiCertificate.checkDomain {D : Type u} {E : Type v} [Zero D] [DecidableEq D] [One D] [Add D] [Sub D] [Mul D] [NatCast D] (sign : D → Int) (endpointSigns : EndpointSigns D E) (p : DensePoly D) (a b : Endpoint E) (squarefree : SignedRemainderChain D) :

                              The domain part of finite replay, independent of the query polynomial. This checks supplied witnesses and never invokes a producer or gcd search.

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                def Hex.TarskiCertificate.checkQuery {D : Type u} {E : Type v} {Ctx : Type w} [Zero D] [DecidableEq D] [Add D] [Sub D] [Mul D] [NatCast D] (sign : D → Int) (endpointSigns : EndpointSigns D E) (p f : DensePoly D) (a b : Endpoint E) (value : Int) (cert : TarskiCertificate D E Ctx) :

                                The query-dependent part of finite replay. Domain and literal input bindings are checked separately by the complete checker.

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  def Hex.TarskiCertificate.check {D : Type u} {E : Type v} {Ctx : Type w} [Zero D] [DecidableEq D] [One D] [Add D] [Sub D] [Mul D] [NatCast D] [DecidableEq E] [DecidableEq Ctx] (sign : D → Int) (endpointSigns : EndpointSigns D E) (context : Ctx) (p f : DensePoly D) (a b : Endpoint E) (value : Int) (cert : TarskiCertificate D E Ctx) :

                                  Check full literal bindings, both chain replays, exact endpoint signs and variations. Arithmetic equations use zero differences; input and context bindings use literal equality. The checker never calls a producer.

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    theorem Hex.TarskiCertificate.check_eq {D : Type u} {E : Type v} {Ctx : Type w} [Zero D] [DecidableEq D] [One D] [Add D] [Sub D] [Mul D] [NatCast D] [DecidableEq E] [DecidableEq Ctx] (sign : D → Int) (endpointSigns : EndpointSigns D E) (context : Ctx) (p f : DensePoly D) (a b : Endpoint E) (value : Int) (cert : TarskiCertificate D E Ctx) :
                                    check sign endpointSigns context p f a b value cert = (((decide (cert.context = context) && decide (cert.head = p) && decide (cert.queryPoly = f) && decide (cert.lower = a) && decide (cert.upper = b) && decide (cert.value = value) && checkEndpoints endpointSigns p a b && SignedRemainderChain.check sign p 1 cert.squarefree && cert.squarefree.lastIsConstant && SignedRemainderChain.check sign p f cert.remainders && decide (cert.lowerSigns = signs sign endpointSigns cert.remainders.chain a) && decide (cert.upperSigns = signs sign endpointSigns cert.remainders.chain b) && cert.lowerSigns.all fun (s : Int) => decide (-1 ≤ s) && decide (s ≤ 1)) && cert.upperSigns.all fun (s : Int) => decide (-1 ≤ s) && decide (s ≤ 1)) && decide (cert.lowerVariations = signVar cert.lowerSigns.toList) && decide (cert.upperVariations = signVar cert.upperSigns.toList) && decide (value = ↑cert.lowerVariations - ↑cert.upperVariations))

                                    Expanded finite replay contract. Factoring the domain and query checks preserves the Boolean result for every supplied certificate.

                                    Exact dyadic endpoints for integer coefficients.

                                    Equations
                                    Instances For

                                      Positive integer content normalization; the producer calls it only on a nonzero remainder. It never changes the input head or makes entries monic.

                                      Equations
                                      Instances For

                                        The signed sum at roots in the open interval, with nonzero squarefree input and root-free endpoints. Invalid mathematical inputs return none.

                                        Equations
                                        Instances For
                                          @[reducible, inline]

                                          The integer/dyadic specialization of the shared literal replay.

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