Documentation

Linglib.Typology.Universal

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 #

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.decidableBAllMultisetQuot.mk and may exhaust kernel recursion depth on samples larger than a handful. Two mathlib-blessed fixes for consumers:

A 2×2 tetrachoric contingency table.

Cells are named for whether the two predicates hold (p) or fail (n):

cellrow Pcolumn Q
pptruetrue
pntruefalse
npfalsetrue
nnfalsefalse

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 :

    P holds, Q fails — the Type IV (counterexample) cell.

  • np :

    P fails, Q holds.

  • nn :

    Both predicates fail.

Instances For
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      def Typology.instDecidableEqContingencyTable.decEq (x✝ x✝¹ : ContingencyTable) :
      Decidable (x✝ = x✝¹)
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For

        Total number of languages tabulated.

        Equations
        Instances For

          Marginal count of languages with P.

          Equations
          Instances For

            Marginal count of languages with Q.

            Equations
            Instances For
              def Typology.ImplicationalUniversal {α : Type u} (P Q : αProp) (s : Finset α) :

              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
              Instances For
                @[implicit_reducible]
                instance Typology.instDecidableImplicationalUniversalOfDecidablePred {α : Type u} (P Q : αProp) (s : Finset α) [DecidablePred P] [DecidablePred Q] :
                Decidable (ImplicationalUniversal P Q s)
                Equations
                def Finset.contingency {α : Type u} (s : Finset α) (P Q : αProp) [DecidablePred P] [DecidablePred Q] :

                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 := {ls | P l Q l}.card, pn := {ls | P l ¬Q l}.card, np := {ls | ¬P l Q l}.card, nn := {ls | ¬P l ¬Q l}.card }
                Instances For
                  theorem Typology.implicational_iff_no_typeIV {α : Type u} (s : Finset α) (P Q : αProp) [DecidablePred P] [DecidablePred Q] :
                  ImplicationalUniversal P Q s (s.contingency P Q).pn = 0

                  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.