Soundness of the projectivity calculus #
This file gives the seven relations their lattice content and proves
the tables of Logic/Natural/Basic.lean sound for it, over bounded
lattices: chained relations compose as the join table says, and each
signature's projection row holds of every function in the signature's
class.
Main declarations #
Relation.Holds: the lattice content of a relation;equivis equality,forwardis≤,negationisIsCompl,alternationisDisjoint,coverisCodisjoint.Relation.holds_iff:Holdsis the conjunction of theRelation.constraintsatoms (Relation.Atom.Holds).Relation.Holds.join: soundness of the join table.Signature.SoundFor: a signature's projection row is sound for a function.soundFor_mono_iff,soundFor_anti_iff: the monotone rows characterize the monotone and antitone functions.soundFor_additive…soundFor_antiAddMult: the algebraic rows, fromIsCompletely*hypotheses.SoundFor.comp,soundFor_contextProjectivity: soundness composes alongSignature.composeand folds along a signature path.Relation.Holds.of_le,Signature.SoundFor.of_le: both implication orders are semantically sound.
Implementation notes #
The algebraic rows hold in the sound direction only — projection rows
are class-maximal, not function-characterizing; tightness is proved in
Logic/Natural/Completeness.lean for the join table. The
additive-family rows need the IsCompletely* unit conditions, exactly
as [Ica12]'s tables assume, and the proofs go through over
bounded lattices rather than his Boolean lattices. soundFor_all
holds unconditionally: every function realizes the no-property row.
References #
- [Ica12] — Definitions 1.2 and 2.3, Lemmas 1.6 and 2.5.
Lattice content of the relations #
The lattice content of a natural-logic relation ([Ica12]
Definition 1.2), in mathlib's complementation vocabulary: negation is
IsCompl, alternation is Disjoint, cover is Codisjoint; forward
is non-strict ≤ (MacCartney's exclusive reading takes it proper, which
the projectivity tables do not need).
Equations
- NaturalLogic.Relation.equiv.Holds = fun (x1 x2 : α) => x1 = x2
- NaturalLogic.Relation.forward.Holds = fun (x1 x2 : α) => x1 ≤ x2
- NaturalLogic.Relation.reverse.Holds = fun (x1 x2 : α) => x1 ≥ x2
- NaturalLogic.Relation.negation.Holds = IsCompl
- NaturalLogic.Relation.alternation.Holds = Disjoint
- NaturalLogic.Relation.cover.Holds = Codisjoint
- NaturalLogic.Relation.independent.Holds = fun (x x_1 : α) => True
Instances For
The lattice content of an atomic constraint ([Ica12] Definition 1.2).
Equations
- NaturalLogic.Relation.Atom.le.Holds = fun (x1 x2 : α) => x1 ≤ x2
- NaturalLogic.Relation.Atom.ge.Holds = fun (x1 x2 : α) => x1 ≥ x2
- NaturalLogic.Relation.Atom.disjoint.Holds = Disjoint
- NaturalLogic.Relation.Atom.codisjoint.Holds = Codisjoint
Instances For
A relation's content is the conjunction of its constraint atoms:
constraints is the single source of truth for Holds.
Equations
- NaturalLogic.Relation.Atom.le.decidableHolds x✝¹ x✝ = NaturalLogic.Relation.Atom.decidableHolds._aux_1 x✝¹ x✝
- NaturalLogic.Relation.Atom.ge.decidableHolds x✝¹ x✝ = NaturalLogic.Relation.Atom.decidableHolds._aux_3 x✝¹ x✝
- NaturalLogic.Relation.Atom.disjoint.decidableHolds x✝¹ x✝ = decidable_of_iff (x✝¹ ⊓ x✝ = ⊥) ⋯
- NaturalLogic.Relation.Atom.codisjoint.decidableHolds x✝¹ x✝ = decidable_of_iff (x✝¹ ⊔ x✝ = ⊤) ⋯
Equations
- NaturalLogic.Relation.equiv.decidableHolds x✝¹ x✝ = NaturalLogic.Relation.decidableHolds._aux_1 x✝¹ x✝
- NaturalLogic.Relation.forward.decidableHolds x✝¹ x✝ = NaturalLogic.Relation.decidableHolds._aux_3 x✝¹ x✝
- NaturalLogic.Relation.reverse.decidableHolds x✝¹ x✝ = NaturalLogic.Relation.decidableHolds._aux_5 x✝¹ x✝
- NaturalLogic.Relation.negation.decidableHolds x✝¹ x✝ = decidable_of_iff (x✝¹ ⊓ x✝ = ⊥ ∧ x✝¹ ⊔ x✝ = ⊤) ⋯
- NaturalLogic.Relation.alternation.decidableHolds x✝¹ x✝ = decidable_of_iff (x✝¹ ⊓ x✝ = ⊥) ⋯
- NaturalLogic.Relation.cover.decidableHolds x✝¹ x✝ = decidable_of_iff (x✝¹ ⊔ x✝ = ⊤) ⋯
- NaturalLogic.Relation.independent.decidableHolds x✝¹ x✝ = isTrue trivial
Join soundness #
The join table is sound: chained relations compose as join says.
Distributivity is needed for the cells that reason through a complement
(negation ⋈ negation = equiv is uniqueness of complements).
Soundness of a signature for a function #
A signature σ is sound for f when f projects every relation as
σ's row of the projection table says ([Ica12] Lemma 2.5: every
φ-function projects R to [R]^φ).
Equations
- σ.SoundFor f = ∀ (R : NaturalLogic.Relation) (x y : α), R.Holds x y → (NaturalLogic.Signature.project R σ).Holds (f x) (f y)
Instances For
The .mono row is sound for exactly the monotone functions.
The .anti row is sound for exactly the antitone functions.
The .additive row is sound for completely additive functions.
The .mult row is sound for completely multiplicative functions.
The .antiAdd row is sound for completely anti-additive functions.
The .antiMult row is sound for completely anti-multiplicative
functions.
The .addMult row (preserve everything) is sound for morphisms:
completely additive and completely multiplicative functions.
The .antiAddMult row is sound for anti-morphisms: completely
anti-additive and completely anti-multiplicative functions. This is the
sentential-negation row — the semantic content of "double negation is a
morphism".
Every function realizes the • row: .all is the no-property
signature, projecting every relation to #.
Projection is monotone in the signature order: a more specific signature projects every relation at least as informatively.
Signature-order soundness: if σ refines τ (every σ-function is a τ-function), σ-soundness implies τ-soundness. This is the theorem that makes the refinement order mean class inclusion.
Composition and paths #
Soundness composes along Signature.compose ([Ica12]
Lemma 2.7 + Proposition 2.10): if ψ is sound for the outer function and φ
for the inner one, ψ * φ is sound for the composite. This is the theorem
that certifies the enum-level compose table against actual context
functions.
The identity context is sound for the identity signature .addMult.
Path soundness: a path of (signature, context) pairs, each sound,
yields a context sound for contextProjectivity of the signature path —
the semantic counterpart of [Ica12] Definition 2.9's marking
algorithm. Signatures are listed outermost-first, matching
contextProjectivity.
Worked instance: double negation is a morphism, semantically #
Complementation in a Boolean algebra is completely anti-additive and
anti-multiplicative, so the .antiAddMult row is sound for it;
composing it with itself certifies the enum fact ◇⊟ ∘ ◇⊟ = ⊕⊞ against
the actual function compl ∘ compl.
Complementation realizes the anti-morphism row.
Propositional negation realizes the anti-morphism row at the Prop
instance.
Per-position profiles #
Two-place operators carry one signature per argument position — a
determiner is one signature in its restrictor and another in its scope.
Signature₂ records the pair, Signature₂.SoundFor says each component is sound
for the corresponding section (the other argument held constant), and
Signature.SoundFor.comp₂ composes an outer context into both
positions at once. Certified instances for generalized quantifiers live
in Semantics/Quantification/Signatures.lean.
A per-position signature profile for a two-place operator. For determiners the positions are restrictor and scope; under the restrictor analysis of conditionals, antecedent and consequent.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- NaturalLogic.instReprSignature₂ = { reprPrec := NaturalLogic.instReprSignature₂.repr }
A profile is sound for a two-place operator when each component signature is sound for the corresponding section (the other argument held constant).
Equations
- σ.SoundFor f = ((∀ (y : β), σ.restrictor.SoundFor fun (x : α) => f x y) ∧ ∀ (x : α), σ.scope.SoundFor (f x))
Instances For
Composing a sound outer context into a sound two-place operator
composes the profile componentwise — the two-place form of
Signature.SoundFor.comp.
The function class of a signature #
The function class a property asserts.
Equations
- NaturalLogic.Signature.Property.monotone.HoldsFor = Monotone
- NaturalLogic.Signature.Property.antitone.HoldsFor = Antitone
- NaturalLogic.Signature.Property.additive.HoldsFor = IsCompletelyAdditive
- NaturalLogic.Signature.Property.multiplicative.HoldsFor = IsCompletelyMultiplicative
- NaturalLogic.Signature.Property.antiAdditive.HoldsFor = IsCompletelyAntiAdditive
- NaturalLogic.Signature.Property.antiMultiplicative.HoldsFor = IsCompletelyAntiMultiplicative
Instances For
A function has signature σ — is a "σ-function" — when it has every property σ asserts.
Equations
- σ.HoldsFor f = ∀ p ∈ σ.properties, p.HoldsFor f
Instances For
σ's projection row is sound for every σ-function ([Ica12] Lemma 2.5), aggregating the per-row theorems.
The class of a more specific signature is included in the class of a
less specific one — the sound direction of the refinement order, with the
converse in Logic/Natural/Completeness.lean (le_iff_holdsFor).
A map with adjoints on both sides is in the morphism class ⊕⊞ — the Lawvere reading of the signature: bi-adjoints preserve everything.
Complementation, the self-dual adjoint pair, is in the anti-morphism class ◇⊟.
Equations
- NaturalLogic.Signature.Property.monotone.decidableHoldsFor x✝ = decidable_of_iff (∀ (a b : α), a ≤ b → x✝ a ≤ x✝ b) ⋯
- NaturalLogic.Signature.Property.antitone.decidableHoldsFor x✝ = decidable_of_iff (∀ (a b : α), a ≤ b → x✝ b ≤ x✝ a) ⋯
- NaturalLogic.Signature.Property.additive.decidableHoldsFor x✝ = decidable_of_iff ((∀ (p q : α), x✝ (p ⊔ q) = x✝ p ⊔ x✝ q) ∧ x✝ ⊤ = ⊤) ⋯
- NaturalLogic.Signature.Property.multiplicative.decidableHoldsFor x✝ = decidable_of_iff ((∀ (p q : α), x✝ (p ⊓ q) = x✝ p ⊓ x✝ q) ∧ x✝ ⊥ = ⊥) ⋯
- NaturalLogic.Signature.Property.antiAdditive.decidableHoldsFor x✝ = decidable_of_iff ((∀ (p q : α), x✝ (p ⊔ q) = x✝ p ⊓ x✝ q) ∧ x✝ ⊤ = ⊥) ⋯
- NaturalLogic.Signature.Property.antiMultiplicative.decidableHoldsFor x✝ = decidable_of_iff ((∀ (p q : α), x✝ (p ⊓ q) = x✝ p ⊔ x✝ q) ∧ x✝ ⊥ = ⊤) ⋯