Equations
- Hex.RCF.instReprSign.repr Hex.RCF.Sign.neg prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Hex.RCF.Sign.neg")).group prec✝
- Hex.RCF.instReprSign.repr Hex.RCF.Sign.zero prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Hex.RCF.Sign.zero")).group prec✝
- Hex.RCF.instReprSign.repr Hex.RCF.Sign.pos prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Hex.RCF.Sign.pos")).group prec✝
Instances For
Equations
- Hex.RCF.instReprSign = { reprPrec := Hex.RCF.instReprSign.repr }
Canonical integer representative of a stored sign.
Equations
Instances For
Collapse an arbitrary integer to its three-way sign.
Equations
- Hex.RCF.Sign.ofInt value = if value < 0 then Hex.RCF.Sign.neg else if 0 < value then Hex.RCF.Sign.pos else Hex.RCF.Sign.zero
Instances For
Exact executable sign of an integer polynomial at a dyadic point.
Equations
- Hex.RCF.evalSign p x = Hex.RCF.Sign.ofInt (Hex.dyadicSign (p.evalDyadic x))
Instances For
Coefficient-equality membership test for literal polynomials. This avoids the derived array equality that does not kernel-reduce through modules.
Equations
- Hex.RCF.containsPoly p [] = false
- Hex.RCF.containsPoly p (q :: qs) = (Hex.DensePoly.beqCoeffs p q || Hex.RCF.containsPoly p qs)
Instances For
Coefficient-based polynomial membership agrees with list membership.
First-occurrence-preserving duplicate removal with an explicit seen set.
Equations
- Hex.RCF.dedupPolysAux seen [] = []
- Hex.RCF.dedupPolysAux seen (q :: qs) = if Hex.RCF.containsPoly q seen = true then Hex.RCF.dedupPolysAux seen qs else q :: Hex.RCF.dedupPolysAux (q :: seen) qs
Instances For
Deterministic first-occurrence-preserving duplicate removal using only coefficient equality.
Equations
Instances For
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
- Hex.RCF.checkCommon carrier [] [] = true
- Hex.RCF.checkCommon carrier (p :: ps) (common :: commons) = (Hex.RCF.CommonRootCert.check p carrier common && Hex.RCF.checkCommon carrier ps commons)
- Hex.RCF.checkCommon carrier x✝¹ x✝ = false
Instances For
Positional lookup in an aligned common-root package list.
Equations
- Hex.RCF.findCommon? p (q :: qs) (common :: commons) = if Hex.DensePoly.beqCoeffs p q = true then some common else Hex.RCF.findCommon? p qs commons
- Hex.RCF.findCommon? p x✝¹ x✝ = none
Instances For
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
Exact sign on an open cell, rejecting zero for a nonconstant atom of a valid carrier decomposition.
Equations
- Hex.RCF.openSign? p isolations cut = match Hex.RCF.evalSign p (isolations.openPoint cut) with | Hex.RCF.Sign.zero => none | sign => some sign
Instances For
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
- Hex.RCF.rootSign? p common isolations i = match common.hasRoot isolations.intervals[i] with | true => some Hex.RCF.Sign.zero | false => Hex.RCF.openSign? p isolations i.castSucc
Instances For
Exact sign on an open cell, with constant polynomials evaluated once at zero and nonconstant polynomials guarded against an impossible zero sample.
Equations
- Hex.RCF.openCellSign? p isolations cut = if 0 < Hex.DensePoly.natDegree p then Hex.RCF.openSign? p isolations cut else some (Hex.RCF.evalSign p 0)
Instances For
One cached sign associated with its literal polynomial.
Instances For
Coefficient-equality lookup in a cached sign row.
Equations
- Hex.RCF.findSign? p [] = none
- Hex.RCF.findSign? p (entry :: entries) = if Hex.DensePoly.beqCoeffs p entry.poly = true then some entry.sign else Hex.RCF.findSign? p entries
Instances For
Materialize a sign row once for each polynomial in a recomputed distinct order. Any missing sign fails the whole row.
Equations
- Hex.RCF.buildSigns? signOf [] = some []
- Hex.RCF.buildSigns? signOf (q :: qs) = do let sign ← signOf q let entries ← Hex.RCF.buildSigns? signOf qs pure ({ poly := q, sign := sign } :: entries)
Instances For
A row built from an option-valued environment returns exactly that environment on every polynomial included in the row order.
Recompute the distinct nonconstant atom order and validate exact package alignment against the checked carrier.
Equations
- Hex.RCF.SignMatrixCert.check sentence carrier cert = Hex.RCF.checkCommon carrier.carrier (Hex.RCF.dedupPolys sentence.polys) cert.commonRoots
Instances For
Look up the package associated with one nonconstant atom.
Equations
- Hex.RCF.SignMatrixCert.findCommon? sentence cert p = Hex.RCF.findCommon? p (Hex.RCF.dedupPolys sentence.polys) cert.commonRoots
Instances For
Every recomputed nonconstant atom has a checked package after successful alignment.
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
- One or more equations did not get rendered due to their size.
- cert.signWith? commonPolys isolations (Hex.RCF.Cell.open cut) p = Hex.RCF.openCellSign? p isolations cut
Instances For
Public atom-sign lookup, recomputing the deterministic package order.
Equations
- cert.sign? sentence isolations cell p = cert.signWith? (Hex.RCF.dedupPolys sentence.polys) isolations cell p
Instances For
Evaluate a comparison from the sign of its left-hand side.
Equations
- Hex.RCF.Cmp.lt.evalSign sign = (sign == Hex.RCF.Sign.neg)
- Hex.RCF.Cmp.le.evalSign sign = (sign != Hex.RCF.Sign.pos)
- Hex.RCF.Cmp.eq.evalSign sign = (sign == Hex.RCF.Sign.zero)
- Hex.RCF.Cmp.ge.evalSign sign = (sign != Hex.RCF.Sign.neg)
- Hex.RCF.Cmp.gt.evalSign sign = (sign == Hex.RCF.Sign.pos)
- Hex.RCF.Cmp.ne.evalSign sign = (sign != Hex.RCF.Sign.zero)
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
- Hex.RCF.Formula.evalSigns signOf (Hex.RCF.Formula.atom a) = do let sign ← signOf a.p pure (a.cmp.evalSign sign)
- Hex.RCF.Formula.evalSigns signOf Hex.RCF.Formula.tt = some true
- Hex.RCF.Formula.evalSigns signOf Hex.RCF.Formula.ff = some false
- Hex.RCF.Formula.evalSigns signOf φ.not = do let value ← Hex.RCF.Formula.evalSigns signOf φ pure !value
- Hex.RCF.Formula.evalSigns signOf (φ.and ψ) = do let left ← Hex.RCF.Formula.evalSigns signOf φ let right ← Hex.RCF.Formula.evalSigns signOf ψ pure (left && right)
- Hex.RCF.Formula.evalSigns signOf (φ.or ψ) = do let left ← Hex.RCF.Formula.evalSigns signOf φ let right ← Hex.RCF.Formula.evalSigns signOf ψ pure (left || right)
- Hex.RCF.Formula.evalSigns signOf (φ.imp ψ) = do let left ← Hex.RCF.Formula.evalSigns signOf φ let right ← Hex.RCF.Formula.evalSigns signOf ψ pure (!left || right)
Instances For
Evaluate a formula whose atoms are all constant, without constructing a carrier decomposition.
Equations
- formula.evalConstants? = Hex.RCF.Formula.evalSigns (fun (p : Hex.ZPoly) => some (Hex.RCF.evalSign p 0)) formula
Instances For
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.