Implicational universals and 2×2 contingency tables #
@cite{greenberg-1963} @cite{dryer-1992}
A Greenbergian implicational universal of the form "if a language is φ then it is also ψ" is the claim that the Type IV cell of a 2×2 contingency table (φ ∧ ¬ψ) is empty over the relevant language sample. This file gives the minimal, sample-polymorphic API for stating, computing, and bridging implicational universals to their tetrachoric form.
Design #
ImplicationalUniversal P Q s : Prop— the universal claim "everyl ∈ swith propertyPalso has propertyQ" over aFinsetsample.ContingencyTable— named-field 2×2 cell counts (pp pn np nn : ℕ), preferred over an opaqueFin 4 → ℕ.Finset.contingency— derive aContingencyTablefrom a sample by counting elements that satisfy each combination ofPandQ.implicational_iff_no_typeIV— the bridge:ImplicationalUniversal P Q sholds iff the table's Type IV cell (pn) is zero. The load-bearing theorem that keeps tetrachoric and propositional formulations in sync.
The language type is left abstract (α); concrete samples instantiate it
to the appropriate Fragment-derived profile type
(Typology.WordOrder.WordOrderProfile, etc.).
Decidability over literal samples #
decide on ImplicationalUniversal P Q {a, b, …} routes through
Finset.decidableBAll → Multiset → Quot.mk and may exhaust kernel
recursion depth on samples larger than a handful. Two mathlib-blessed
fixes for consumers:
simp only [Finset.forall_mem_insert, Finset.forall_mem_empty] <;> decide— structural decomposition into a conjunction of per-language goals.set_option maxRecDepth N in theorem ...— brute-force; mathlib uses this idiom for similarFinset.decidesites.
A 2×2 tetrachoric contingency table.
Cells are named for whether the two predicates hold (p) or fail (n):
| cell | row P | column Q |
|---|---|---|
pp | true | true |
pn | true | false |
np | false | true |
nn | false | false |
For an implication P → Q, the Type IV cell is pn: languages that
have P but lack Q are the counterexamples.
- pp : ℕ
Both predicates hold.
- pn : ℕ
Pholds,Qfails — the Type IV (counterexample) cell. - np : ℕ
Pfails,Qholds. - nn : ℕ
Both predicates fail.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Typology.instReprContingencyTable = { reprPrec := Typology.instReprContingencyTable.repr }
Equations
- One or more equations did not get rendered due to their size.
Instances For
Total number of languages tabulated.
Instances For
Marginal count of languages with P.
Instances For
Marginal count of languages with Q.
Instances For
Greenbergian implicational universal: every language in sample s that
satisfies P also satisfies Q. The "no Type IV gap" formulation,
(Finset.contingency s P Q).pn = 0, is logically equivalent (see
implicational_iff_no_typeIV).
Equations
- Typology.ImplicationalUniversal P Q s = ∀ l ∈ s, P l → Q l
Instances For
Equations
- Typology.instDecidableImplicationalUniversalOfDecidablePred P Q s = Finset.decidableDforallFinset
Build a 2×2 contingency table by counting elements of s that satisfy
each combination of P and Q.
Equations
- s.contingency P Q = { pp := {l ∈ s | P l ∧ Q l}.card, pn := {l ∈ s | P l ∧ ¬Q l}.card, np := {l ∈ s | ¬P l ∧ Q l}.card, nn := {l ∈ s | ¬P l ∧ ¬Q l}.card }
Instances For
Bridge between the propositional and tetrachoric formulations: an implicational universal holds iff its Type IV cell is empty.
@cite{greenberg-1963}'s reformulation of "P implies Q" as "no language is P-but-not-Q" — same content, expressed once as a universal statement and once as a count-zero claim.