Documentation

HexRCF.SignMatrixCheck

inductive Hex.RCF.Sign :

The three possible signs stored by an RCF sign matrix.

  • neg : Sign

    A negative value.

  • zero : Sign

    A zero value.

  • pos : Sign

    A positive value.

Instances For
    @[instance_reducible]
    Equations
    @[instance_reducible]
    Equations

    Canonical integer representative of a stored sign.

    Equations
    Instances For
      def Hex.RCF.Sign.ofInt (value : Int) :

      Collapse an arbitrary integer to its three-way sign.

      Equations
      Instances For

        Exact executable sign of an integer polynomial at a dyadic point.

        Equations
        Instances For

          Coefficient-equality membership test for literal polynomials. This avoids the derived array equality that does not kernel-reduce through modules.

          Equations
          Instances For

            Coefficient-based polynomial membership agrees with list membership.

            The coefficient-equality membership test is false exactly on nonmembership.

            First-occurrence-preserving duplicate removal with an explicit seen set.

            Equations
            Instances For

              Deterministic first-occurrence-preserving duplicate removal using only coefficient equality.

              Equations
              Instances For
                theorem Hex.RCF.mem_dedupPolysAux {p : ZPoly} {seen ps : List ZPoly} :
                p dedupPolysAux seen ps p ps ¬p seen

                A polynomial survives duplicate removal exactly when it occurs in the input and has not already occurred in seen.

                theorem Hex.RCF.mem_dedupPolys {p : ZPoly} {ps : List ZPoly} :
                p dedupPolys ps p ps

                Duplicate removal preserves polynomial membership.

                Duplicate removal with an initial seen list produces no duplicate entries.

                Duplicate removal produces no duplicate entries.

                Pair a recomputed polynomial order with common-root packages and validate every package. Length mismatches and malformed packages are rejected.

                Equations
                Instances For

                  Positional lookup in an aligned common-root package list.

                  Equations
                  Instances For
                    theorem Hex.RCF.findCommon?_of_check {carrier p : ZPoly} {ps : List ZPoly} {commons : List CommonRootCert} (hcheck : checkCommon carrier ps commons = true) (hmem : p ps) :
                    (common : CommonRootCert), findCommon? p ps commons = some common CommonRootCert.check p carrier common = true

                    Checked alignment makes positional lookup total and validates the package against the requested external polynomial.

                    Common-root data carried by the sign-matrix layer. No signs or formula truth values are trusted fields: both are recomputed exactly.

                    • commonRoots : List CommonRootCert

                      Proposed common-root certificates. The checker aligns them with the distinct nonconstant atom polynomials in their recomputed order.

                    Instances For
                      def Hex.RCF.openSign? (p : ZPoly) (isolations : IsolationCert) (cut : Fin (isolations.intervals.size + 1)) :

                      Exact sign on an open cell, rejecting zero for a nonconstant atom of a valid carrier decomposition.

                      Equations
                      Instances For
                        def Hex.RCF.rootSign? (p : ZPoly) (common : CommonRootCert) (isolations : IsolationCert) (i : Fin isolations.intervals.size) :

                        Exact sign on a root cell from the cached common-root zero test, or from the canonical left open sample when the atom does not vanish.

                        Equations
                        Instances For
                          theorem Hex.RCF.openSign?_eq_some {p : ZPoly} {isolations : IsolationCert} {cut : Fin (isolations.intervals.size + 1)} (hnonzero : evalSign p (isolations.openPoint cut) Sign.zero) :
                          openSign? p isolations cut = some (evalSign p (isolations.openPoint cut))

                          A nonzero open-cell evaluation is returned unchanged by openSign?.

                          def Hex.RCF.openCellSign? (p : ZPoly) (isolations : IsolationCert) (cut : Fin (isolations.intervals.size + 1)) :

                          Exact sign on an open cell, with constant polynomials evaluated once at zero and nonconstant polynomials guarded against an impossible zero sample.

                          Equations
                          Instances For

                            One cached sign associated with its literal polynomial.

                            • poly : ZPoly

                              The polynomial whose sign is cached.

                            • sign : Sign

                              The cached sign of the polynomial.

                            Instances For

                              Coefficient-equality lookup in a cached sign row.

                              Equations
                              Instances For

                                Materialize a sign row once for each polynomial in a recomputed distinct order. Any missing sign fails the whole row.

                                Equations
                                Instances For
                                  theorem Hex.RCF.findSign?_of_build {signOf : ZPolyOption Sign} {ps : List ZPoly} {entries : List SignEntry} (hbuild : buildSigns? signOf ps = some entries) {p : ZPoly} (hmem : p ps) :
                                  findSign? p entries = signOf p

                                  A row built from an option-valued environment returns exactly that environment on every polynomial included in the row order.

                                  theorem Hex.RCF.buildSigns?_total {signOf : ZPolyOption Sign} {ps : List ZPoly} (htotal : ∀ (p : ZPoly), p ps (sign : Sign), signOf p = some sign) :
                                  (entries : List SignEntry), buildSigns? signOf ps = some entries

                                  A total option-valued environment builds a complete cached row.

                                  Recompute the distinct nonconstant atom order and validate exact package alignment against the checked carrier.

                                  Equations
                                  Instances For

                                    Look up the package associated with one nonconstant atom.

                                    Equations
                                    Instances For
                                      theorem Hex.RCF.SignMatrixCert.findCommon?_of_check {sentence : Sentence} {carrier : CarrierCert} {cert : SignMatrixCert} (hcheck : check sentence carrier cert = true) {p : ZPoly} (hmem : p sentence.polys) :
                                      (common : CommonRootCert), findCommon? sentence cert p = some common CommonRootCert.check p carrier.carrier common = true

                                      Every recomputed nonconstant atom has a checked package after successful alignment.

                                      def Hex.RCF.SignMatrixCert.signWith? (cert : SignMatrixCert) (commonPolys : List ZPoly) (isolations : IsolationCert) (cell : Cell isolations.intervals.size) (p : ZPoly) :

                                      Recompute one atom sign on one carrier cell using a precomputed distinct nonconstant order. Constants use evaluation at zero and consume no common-root package.

                                      Equations
                                      Instances For
                                        def Hex.RCF.SignMatrixCert.sign? (cert : SignMatrixCert) (sentence : Sentence) (isolations : IsolationCert) (cell : Cell isolations.intervals.size) (p : ZPoly) :

                                        Public atom-sign lookup, recomputing the deterministic package order.

                                        Equations
                                        Instances For
                                          def Hex.RCF.Cmp.evalSign (cmp : Cmp) (sign : Sign) :

                                          Evaluate a comparison from the sign of its left-hand side.

                                          Equations
                                          Instances For

                                            Evaluate a formula from an option-valued polynomial-sign environment. Every Boolean branch evaluates both children, so any missing sign fails closed.

                                            Equations
                                            Instances For

                                              Evaluate a formula whose atoms are all constant, without constructing a carrier decomposition.

                                              Equations
                                              Instances For
                                                def Hex.RCF.SignMatrixCert.evalCell? (cert : SignMatrixCert) (sentence : Sentence) (isolations : IsolationCert) (cell : Cell isolations.intervals.size) :

                                                Recompute the formula truth value on one carrier cell after materializing one exact sign per distinct polynomial. Repeated atom occurrences reuse the cached row entry.

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