NF weak partition development: NFStandard.CylinderCompiler.
StratifiedByBelow cap ty p is a stratification certificate with one global
normalization ceiling. In particular, the witness type chosen at every
quantifier is at most cap. This is the form needed by Hailperin's uniform
singleton normalization: every variable is raised exactly cap - type times,
and that convention is unchanged beneath binders.
Stratification by ty, with every bound-variable type globally capped.
Equations
- NFChoice.Foundation.Formula.StratifiedByBelow cap ty NFChoice.Foundation.Formula.falsum = True
- NFChoice.Foundation.Formula.StratifiedByBelow cap ty (NFChoice.Foundation.Formula.equal x_1 y) = (ty x_1 = ty y)
- NFChoice.Foundation.Formula.StratifiedByBelow cap ty (NFChoice.Foundation.Formula.mem x_1 y) = (ty y = ty x_1 + 1)
- NFChoice.Foundation.Formula.StratifiedByBelow cap ty (p.imp q) = (NFChoice.Foundation.Formula.StratifiedByBelow cap ty p ∧ NFChoice.Foundation.Formula.StratifiedByBelow cap ty q)
- NFChoice.Foundation.Formula.StratifiedByBelow cap ty p.all = ∃ k ≤ cap, NFChoice.Foundation.Formula.StratifiedByBelow cap (fun (i : Fin (n + 1)) => Fin.cases k ty i) p
Instances For
Increasing the normalization ceiling preserves a capped certificate.
Forgetting the global ceiling recovers the ordinary certificate.
A simple upper bound for every entry of a finite type context.
Equations
- NFChoice.Foundation.Formula.contextCap 0 x_2 = 0
- NFChoice.Foundation.Formula.contextCap n.succ ty = max (ty 0) (NFChoice.Foundation.Formula.contextCap n fun (i : Fin n) => ty i.succ)
Instances For
Every ordinary finite stratification admits one cap valid at all binders.
Package a usual stratification as a globally capped one.
Equations
- p.cappedStratification hp = { cap := Classical.choose ⋯, ty := Classical.choose hp, bounded := ⋯, certificate := ⋯ }
Instances For
CylinderAlgebra is the small, typed relation-algebra interface used by the
uniform Hailperin compiler. The cap is fixed for the whole formula, including
all bound variables. A concrete implementation therefore raises coordinate
i by Int.toNat (cap - ty i) singleton steps once and never has to rebase a
tail valuation when a quantifier is crossed.
Operations sufficient to compile globally capped stratified formulas.
The code operation of this NF model presentation.
The empty operation of this NF model presentation.
The compl operation of this NF model presentation.
The inter operation of this NF model presentation.
The eq Set operation of this NF model presentation.
The mem Set operation of this NF model presentation.
The exists Set operation of this NF model presentation.
The slice operation of this NF model presentation.
- mem_memSet {n : ℕ} (cap : ℤ) (ty : Fin n → ℤ) (_hcap : ∀ (i : Fin n), ty i ≤ cap) (i j : Fin n) (_h : ty j = ty i + 1) (xs : DVec S.carrier n) : SemanticCore.Mem S (self.code cap ty xs) (self.memSet cap ty i j) ↔ SemanticCore.Mem S (SemanticCore.Lowering.lookup xs i) (SemanticCore.Lowering.lookup xs j)
- mem_existsSet {n : ℕ} (cap : ℤ) (ty : Fin n → ℤ) (_hcap : ∀ (i : Fin n), ty i ≤ cap) (k : ℤ) (_hk : k ≤ cap) (A : S.carrier) (xs : DVec S.carrier n) : SemanticCore.Mem S (self.code cap ty xs) (self.existsSet cap ty k A) ↔ ∃ (a : S.carrier), SemanticCore.Mem S (self.code cap (fun (i : Fin (n + 1)) => Fin.cases k ty i) (DVec.cons a xs)) A
Instances For
Compile a formula using one global normalization cap.
Equations
- One or more equations did not get rendered due to their size.
- C.compile x✝¹ x✝ NFChoice.Foundation.Formula.falsum x_6 = C.empty x✝¹ x✝²
- C.compile x✝¹ x✝ (NFChoice.Foundation.Formula.equal i j) x_6 = C.eqSet x✝¹ x✝ i j
- C.compile x✝¹ x✝ (NFChoice.Foundation.Formula.mem i j) x_6 = C.memSet x✝¹ x✝ i j
- C.compile x✝¹ x✝ (p.imp q) h = C.compl x✝¹ x✝² (C.inter x✝¹ x✝² (C.compile x✝¹ x✝ p ⋯) (C.compl x✝¹ x✝² (C.compile x✝¹ x✝ q ⋯)))
Instances For
The compiler represents exactly the semantic truth set of its formula.
Chosen comprehension object produced by the uniform compiler.
Equations
- C.comprehensionSet p hp xs = C.slice (p.cappedStratification hp).cap (p.cappedStratification hp).ty (C.compile (p.cappedStratification hp).cap (p.cappedStratification hp).ty p ⋯) xs
Instances For
Every cylinder algebra validates the complete standard NF schema.