Documentation

LeanPool.NFWeakPartition.NFStandard.CylinderCompiler

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.

@[simp]
theorem NFChoice.Foundation.Formula.stratifiedByBelow_equal {cap : ℤ} {n : ℕ} (ty : Fin n → ℤ) (x y : Fin n) :
StratifiedByBelow cap ty (equal x y) ↔ ty x = ty y
@[simp]
theorem NFChoice.Foundation.Formula.stratifiedByBelow_mem {cap : ℤ} {n : ℕ} (ty : Fin n → ℤ) (x y : Fin n) :
StratifiedByBelow cap ty (mem x y) ↔ ty y = ty x + 1
@[simp]
theorem NFChoice.Foundation.Formula.stratifiedByBelow_imp {cap : ℤ} {n : ℕ} (ty : Fin n → ℤ) (p q : Formula n) :
@[simp]
theorem NFChoice.Foundation.Formula.stratifiedByBelow_all {cap : ℤ} {n : ℕ} (ty : Fin n → ℤ) (p : Formula (n + 1)) :
StratifiedByBelow cap ty p.all ↔ ∃ k ≤ cap, StratifiedByBelow cap (fun (i : Fin (n + 1)) => Fin.cases k ty i) p
theorem NFChoice.Foundation.Formula.StratifiedByBelow.mono {cap cap' : ℤ} {n : ℕ} {ty : Fin n → ℤ} {p : Formula n} :
cap ≤ cap' → StratifiedByBelow cap ty p → StratifiedByBelow cap' ty p

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
Instances For
    theorem NFChoice.Foundation.Formula.le_contextCap {n : ℕ} (ty : Fin n → ℤ) (i : Fin n) :
    ty i ≤ contextCap n ty
    theorem NFChoice.Foundation.Formula.exists_stratifiedByBelow {n : ℕ} (ty : Fin n → ℤ) (p : Formula n) :
    StratifiedBy ty p → ∃ (cap : ℤ), (∀ (i : Fin n), ty i ≤ cap) ∧ StratifiedByBelow cap ty p

    Every ordinary finite stratification admits one cap valid at all binders.

    A selected global cap and capped certificate for a stratified formula.

    • cap : ℤ

      The cap component of the corresponding first-order structure.

    • ty : Fin n → ℤ

      The ty component of the corresponding first-order structure.

    • bounded (i : Fin n) : self.ty i ≤ self.cap
    • certificate : StratifiedByBelow self.cap self.ty p
    Instances For

      Package a usual stratification as a globally capped one.

      Equations
      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.

        Instances For
          noncomputable def NFChoice.Foundation.NFStandard.CylinderAlgebra.compile {S : Fol.Structure LNF} (C : CylinderAlgebra S) {n : ℕ} (cap : ℤ) (ty : Fin n → ℤ) (p : Formula n) :

          Compile a formula using one global normalization cap.

          Equations
          Instances For
            theorem NFChoice.Foundation.NFStandard.CylinderAlgebra.mem_compile {S : Fol.Structure LNF} (C : CylinderAlgebra S) {n : ℕ} (cap : ℤ) (ty : Fin n → ℤ) (p : Formula n) (_hcap : ∀ (i : Fin n), ty i ≤ cap) (hp : Formula.StratifiedByBelow cap ty p) (xs : DVec S.carrier n) :
            SemanticCore.Mem S (C.code cap ty xs) (C.compile cap ty p hp) ↔ SemanticCore.Lowering.FormulaHolds S xs p

            The compiler represents exactly the semantic truth set of its formula.

            Chosen comprehension object produced by the uniform compiler.

            Equations
            Instances For

              Every cylinder algebra validates the complete standard NF schema.