Countable Code Layer for Lω₁ω Formulas #
Legacy / off-path. The Scott analysis pipeline was decoupled from the FormulaCode
bridge (see the notes around per_tuple_stabilization_below_omega1 in
Scott/Sentence.lean), so this module is no longer imported by any library root; it is
kept for its public FormulaCode API and is reachable via InfinitaryLogic.Everything.
This file defines a countable code type for Lω₁ω formulas over a countable relational language, and proves the key bridge lemma: if two tuples agree on all codes of bounded quantifier rank, they are BFEquiv.
Main Definitions #
FormulaCode/FormulaCodeList: A countable mutual inductive type encoding Lω₁ω formulas. Uses explicit list structure (instead ofℕ →) for branching, ensuring countability.FormulaCode.toFormulaω: Interprets a code as an actualBoundedFormulaωformula.
Main Results #
FormulaCode.instCountable:Countable (FormulaCode L n).BFEquiv_implies_agree_codes: BFEquiv implies agreement on all codes.agree_codes_implies_BFEquiv: Agreement on all codes implies BFEquiv. This is the key bridge from the countable world to the BFEquiv game.
Implementation Notes #
In our Lean formalization, BoundedFormulaω is uncountable (due to ℕ → BoundedFormulaω
in iSup/iInf). The FormulaCode type provides a countable proxy: it uses an explicit
list structure instead of ℕ → for branching, making the type countable. While FormulaCode
cannot represent all Lω₁ω formulas, every Lω₁ω formula (including every Scott formula) is
logically equivalent to a conjunction of code-representable formulas, because codes capture
all atomic facts and all finite approximations of countable conjunctions/disjunctions.
Countable codes for Lω₁ω formulas.
Uses an explicit cons/nil list (instead of ℕ →) for conjunctions/disjunctions.
The key property is Countable (FormulaCode L n).
- falsum {L : Language} {n : ℕ} : L.FormulaCode n
- equal {L : Language} {n : ℕ} (i j : Fin n) : L.FormulaCode n
- rel {L : Language} {n l : ℕ} (R : L.Relations l) (f : Fin l → Fin n) : L.FormulaCode n
- imp {L : Language} {n : ℕ} (φ ψ : L.FormulaCode n) : L.FormulaCode n
- all {L : Language} {n : ℕ} (φ : L.FormulaCode (n + 1)) : L.FormulaCode n
- iSup {L : Language} {n : ℕ} (φs : L.FormulaCodeList n) : L.FormulaCode n
- iInf {L : Language} {n : ℕ} (φs : L.FormulaCodeList n) : L.FormulaCode n
Instances For
List of formula codes, used for countable conjunctions/disjunctions.
- nil {L : Language} {n : ℕ} : L.FormulaCodeList n
- cons {L : Language} {n : ℕ} (head : L.FormulaCode n) (tail : L.FormulaCodeList n) : L.FormulaCodeList n
Instances For
Equations
Equations
- FirstOrder.Language.FormulaCode.falsum.encode = Nat.pair 0 0
- (FirstOrder.Language.FormulaCode.equal i j).encode = Nat.pair 1 (Nat.pair ↑i ↑j)
- (FirstOrder.Language.FormulaCode.rel R f).encode = Nat.pair 2 (Nat.pair (Encodable.encode ⟨l, R⟩) (FirstOrder.Language.FormulaCode.encodeFin✝ l n f))
- (φ.imp ψ).encode = Nat.pair 3 (Nat.pair φ.encode ψ.encode)
- φ.all.encode = Nat.pair 4 φ.encode
- (FirstOrder.Language.FormulaCode.iSup φs).encode = Nat.pair 5 (FirstOrder.Language.FormulaCode.encodeList φs)
- (FirstOrder.Language.FormulaCode.iInf φs).encode = Nat.pair 6 (FirstOrder.Language.FormulaCode.encodeList φs)
Instances For
Equations
Instances For
Interpret a code as an actual Lω₁ω formula.
Equations
- FirstOrder.Language.FormulaCode.falsum.toFormulaω = ⊥
- (FirstOrder.Language.FormulaCode.equal i j).toFormulaω = FirstOrder.Language.BoundedFormulaω.equal (FirstOrder.Language.var (Sum.inl i)) (FirstOrder.Language.var (Sum.inl j))
- (FirstOrder.Language.FormulaCode.rel R f).toFormulaω = FirstOrder.Language.BoundedFormulaω.rel R fun (k : Fin l) => FirstOrder.Language.var (Sum.inl (f k))
- (φ.imp ψ).toFormulaω = FirstOrder.Language.BoundedFormulaω.imp φ.toFormulaω ψ.toFormulaω
- φ.all.toFormulaω = FirstOrder.Language.forallLastVar φ.toFormulaω
- (FirstOrder.Language.FormulaCode.iSup φs).toFormulaω = FirstOrder.Language.BoundedFormulaω.iSup fun (k : ℕ) => (FirstOrder.Language.FormulaCode.toFormulaωList φs).getD k ⊥
- (FirstOrder.Language.FormulaCode.iInf φs).toFormulaω = FirstOrder.Language.BoundedFormulaω.iInf fun (k : ℕ) => (FirstOrder.Language.FormulaCode.toFormulaωList φs).getD k ⊤
Instances For
Interpret a code list as a list of Lω₁ω formulas.
Equations
Instances For
Semantics of a code: realized iff its formula interpretation is realized.
Equations
- c.Realize b = c.toFormulaω.Realize b
Instances For
BFEquiv implies agreement on all formula codes of bounded quantifier rank.