Polarity of relation-symbol occurrences (issue #14, Unit 0 layer 1) #
The signed occurrence traversal underlying Lyndon interpolation: relationsInSigned s φ collects
the relation symbols occurring in φ with sign s, where
- an antecedent flips the sign (
imp); all,iInf,iSuppreserve it;- equality is logical — it contributes to neither sign.
positiveRelationsIn and negativeRelationsIn are the two instances. Negation needs no clause of
its own: φ.not = φ.imp ⊥, so the swap laws
positiveRelationsIn φ.not = negativeRelationsIn φ and its dual fall out of the imp clause, and
the same computation gives and, or, ex, ⊤, einf, esup.
This file is deliberately syntax only and sits in the Lomega1omega layer: it mentions no
occurrence machinery from Methods/ (in particular not relationsIn, baseRelationsIn, or the
constant-expansion calculus). The bridge relationsIn = positive ∪ negative and the signed twins
of the Methods-level calculus live in Methods/PolarityCalculus.lean.
Simp discipline #
Only the generic relationsInSigned equations are @[simp]; the positiveRelationsIn /
negativeRelationsIn forms are reducible abbreviations of those, so no derived rewrite is
installed alongside them and nothing can loop through not, and, or, or ex.
The signed occurrence traversal. relationsInSigned true φ is the set of relation
symbols with a positive occurrence in φ, and relationsInSigned false φ those with a negative
occurrence: antecedents flip the sign, quantifiers and the countable connectives preserve it, and
equality contributes nothing.
Equations
- FirstOrder.Language.BoundedFormulaω.relationsInSigned x✝ FirstOrder.Language.BoundedFormulaω.falsum = ∅
- FirstOrder.Language.BoundedFormulaω.relationsInSigned x✝ (FirstOrder.Language.BoundedFormulaω.equal t₁ t₂) = ∅
- FirstOrder.Language.BoundedFormulaω.relationsInSigned x✝ (FirstOrder.Language.BoundedFormulaω.rel R ts) = if x✝ = true then {⟨l, R⟩} else ∅
- FirstOrder.Language.BoundedFormulaω.relationsInSigned x✝ (φ.imp ψ) = FirstOrder.Language.BoundedFormulaω.relationsInSigned (!x✝) φ ∪ FirstOrder.Language.BoundedFormulaω.relationsInSigned x✝ ψ
- FirstOrder.Language.BoundedFormulaω.relationsInSigned x✝ φ.all = FirstOrder.Language.BoundedFormulaω.relationsInSigned x✝ φ
- FirstOrder.Language.BoundedFormulaω.relationsInSigned x✝ (FirstOrder.Language.BoundedFormulaω.iSup φs) = ⋃ (i : ℕ), FirstOrder.Language.BoundedFormulaω.relationsInSigned x✝ (φs i)
- FirstOrder.Language.BoundedFormulaω.relationsInSigned x✝ (FirstOrder.Language.BoundedFormulaω.iInf φs) = ⋃ (i : ℕ), FirstOrder.Language.BoundedFormulaω.relationsInSigned x✝ (φs i)
Instances For
The relation symbols occurring positively in φ.
Instances For
The relation symbols occurring negatively in φ.
Instances For
Constructor equations #
Negation swaps and the derived connectives #
Negation swaps the signs (the acceptance gate, generic form).
Acceptance gate: positive occurrences of ¬φ are the negative occurrences of φ.
Acceptance gate: negative occurrences of ¬φ are the positive occurrences of φ.
Existential quantification preserves the signs (two flips cancel).
An Encodable-indexed conjunction collects the branches' signed occurrences (the ⊤ padding
of undecodable indices contributes nothing).
An Encodable-indexed disjunction collects the branches' signed occurrences (the ⊥ padding
of undecodable indices contributes nothing).