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 a signature's projection row holds of a function exactly when the function
is monotone or antitone and carries disjoint and codisjoint pairs as the row says. The function
classes of [Ica12] fall in their rows, their unit conditions being mathlib's pairing of
meets with ⊥ and joins with ⊤, and so do bounded lattice homomorphisms and, into the order
dual, complementation.
Main results #
Relation.Holds.join: soundness of the join table.soundFor_additive_iff, …,soundFor_antiAddMult_iff: what each projection row demands of a function.Signature.soundFor_of_holdsFor: a signature's row holds of every function in its class.Signature.SoundFor.comp: soundness composes alongSignature.compose.
Implementation notes #
- Icard works over Boolean algebras; the proofs need only bounded lattices, and distributivity for the join table.
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 #
Chained relations compose as the join table 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 exactly for the monotone functions sending codisjoint pairs to
codisjoint pairs.
The .mult row is sound exactly for the monotone functions sending disjoint pairs to
disjoint pairs.
The .antiAdd row is sound exactly for the antitone functions sending codisjoint pairs to
disjoint pairs.
The .antiMult row is sound exactly for the antitone functions sending disjoint pairs to
codisjoint pairs.
The .addMult row is sound exactly for the monotone functions preserving disjointness and
codisjointness.
The .antiAddMult row is sound exactly for the antitone functions exchanging disjointness
and codisjointness.
A bounded lattice homomorphism realizes the morphism row.
A bounded lattice homomorphism into the order dual realizes the anti-morphism row.
Every function realizes the • row, the no-property signature projecting every relation to
#.
A signature sound for a two-place function is sound for it at any fixed second argument, the lattice operations on functions being pointwise.
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.
A path of (signature, context) pairs, each sound, yields a context sound for
contextProjectivity of the signature path, the semantic counterpart of [Ica12]'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 = fun (f : α → β) => (∀ (p q : α), f (p ⊔ q) = f p ⊔ f q) ∧ f ⊤ = ⊤
- NaturalLogic.Signature.Property.multiplicative.HoldsFor = fun (f : α → β) => (∀ (p q : α), f (p ⊓ q) = f p ⊓ f q) ∧ f ⊥ = ⊥
- NaturalLogic.Signature.Property.antiAdditive.HoldsFor = fun (f : α → β) => NaturalLogic.IsAntiAdditive f ∧ f ⊤ = ⊥
- NaturalLogic.Signature.Property.antiMultiplicative.HoldsFor = fun (f : α → β) => NaturalLogic.IsAntiMultiplicative f ∧ f ⊥ = ⊤
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✝ ⊥ = ⊤) ⋯
Equations
- σ.decidableHoldsFor f = { decide := decide (∀ a ∈ Finset.univ, (fun (p : NaturalLogic.Signature.Property) => p ∈ σ.properties → p.HoldsFor f) a), reflects_decide := ⋯ }