Documentation

Linglib.Semantics.Quantification.NumberTree

The tree of numbers #

This file defines quantifiers on van Benthem's tree of numbers. A conservative quantifier that is invariant under permutations of the universe holds of finite sets A and B according to the two numbers a = |A \ B| and b = |A ∩ B| alone, so it is a set of points (a, b). The points with a + b = n form the n-th row of the tree, the ways of splitting an n-element A.

On this representation inner negation, which negates the scope, swaps the two coordinates, and outer negation is the complement. The four corners of the square of opposition are all, some, no and not all, and the two negations carry each corner to its neighbours.

Van Benthem's postulates of variety, continuity, absence of deadlock and uniformity are each invariant under both negations. That symmetry carries the verification of the postulates, and the proof that the corners are the only quantifiers satisfying them, from all to the other three.

Main definitions #

Main results #

Implementation notes #

Variety asks only that the quantifier hold somewhere and fail somewhere. Van Benthem's VAR is stronger in both of its versions, so results assuming Variety apply under VAR. The paper asks for a presence and an absence among the points (0, 0), (1, 0) and (0, 1), and the book's chapter on quantifiers, which restates the tree and the postulates, asks for both in every row below the top.

Continuity, absence of deadlock and uniformity each treat presence and absence of the quantifier alike. Each is stated as a condition on presence (RowConvex, NoDeadlock, Homogeneous) that is imposed on the quantifier and on its complement.

References #

@[reducible, inline]

A quantifier on the tree of numbers is a relation between a = |A \ B| and b = |A ∩ B|.

Equations
Instances For
    theorem Quantifier.NumberTree.compl_apply {q : NumberTree} {a b : ℕ} :
    qᶜ a b ↔ ¬q a b

    Negations and the square of opposition #

    Inner negation negates the scope, which swaps A \ B with A ∩ B.

    Equations
    Instances For
      @[simp]
      theorem Quantifier.NumberTree.innerNeg_apply {q : NumberTree} {a b : ℕ} :
      q.innerNeg a b ↔ q b a
      @[instance_reducible]
      Equations

      The quantifier all holds when nothing in A lies outside B.

      Equations
      Instances For

        The quantifier some holds when something in A lies in B.

        Equations
        Instances For

          The quantifier no holds when nothing in A lies in B.

          Equations
          Instances For

            The quantifier not all holds when something in A lies outside B.

            Equations
            Instances For
              @[instance_reducible]
              Equations
              @[instance_reducible]
              Equations
              @[instance_reducible]
              Equations
              @[instance_reducible]
              Equations

              A cardinal quantifier holds according to |A ∩ B| alone, as the numerals do.

              Equations
              Instances For
                @[simp]
                theorem Quantifier.NumberTree.cardinal_apply {a b : ℕ} {s : Set ℕ} :
                cardinal s a b ↔ b ∈ s
                def Quantifier.NumberTree.ofSizes (c : ℕ → ℕ → Prop) :

                The tree of a relation c between |A ∩ B| and |A| holds at (a, b) when c relates b to a + b, the form in which proportions of the restrictor are stated.

                Equations
                Instances For
                  @[simp]
                  theorem Quantifier.NumberTree.ofSizes_apply {a b : ℕ} {c : ℕ → ℕ → Prop} :
                  ofSizes c a b ↔ c b (a + b)

                  Rows #

                  Row n of the tree lists the ways of splitting n members of A between B and its complement. A point of the row is given by the number of members inside B.

                  def Quantifier.NumberTree.row (q : NumberTree) [DecidableRel q] (n : ℕ) :
                  Finset (Fin (n + 1))

                  The points of row n at which a quantifier holds, each given by |A ∩ B|.

                  Equations
                  • q.row n = {b : Fin (n + 1) | q (n - ↑b) ↑b}
                  Instances For
                    @[simp]
                    theorem Quantifier.NumberTree.mem_row {q : NumberTree} [DecidableRel q] {n : ℕ} {b : Fin (n + 1)} :
                    b ∈ q.row n ↔ q (n - ↑b) ↑b

                    Scope monotonicity #

                    Enlarging the scope B by an element of A moves one individual from A \ B to A ∩ B, a step to the right along a row of the tree.

                    A quantifier is scope monotone when a step right along a row preserves truth.

                    Equations
                    Instances For

                      A quantifier is scope antitone when a step left along a row preserves truth.

                      Equations
                      Instances For
                        theorem Quantifier.NumberTree.ScopeMonotone.shift {q : NumberTree} (h : q.ScopeMonotone) (k : ℕ) {a b : ℕ} (hq : q (a + k) b) :
                        q a (b + k)

                        Iterated, a scope-monotone quantifier survives moving k individuals into the scope.

                        theorem Quantifier.NumberTree.scopeMonotone_ofSizes {c : ℕ → ℕ → Prop} (hc : ∀ (p : ℕ), Monotone fun (x : ℕ) => c x p) :

                        A relation closed upwards in |A ∩ B| is scope monotone on the tree.

                        theorem Quantifier.NumberTree.scopeAntitone_ofSizes {c : ℕ → ℕ → Prop} (hc : ∀ (p : ℕ), Antitone fun (x : ℕ) => c x p) :

                        A relation closed downwards in |A ∩ B| is scope antitone on the tree.

                        Relational conditions #

                        A condition on the relation Q A B between sets becomes a condition on the tree once the sets are replaced by the sizes of the cells of their Venn diagram.

                        A quantifier is asymmetric when Q A B excludes Q B A. The two share |A ∩ B|, and |A \ B| and |B \ A| are arbitrary.

                        Equations
                        • q.Asymmetric = ∀ (a b c : ℕ), q a c → ¬q b c
                        Instances For

                          A quantifier is strongly connected when Q A B or Q B A holds of any two sets.

                          Equations
                          Instances For

                            A quantifier is irreflexive when Q A A never holds.

                            Equations
                            Instances For

                              A quantifier is Euclidean when Q X Y and Q X Z give Q Y Z. Among the cells of the Venn diagram of X, Y and Z, p counts X ∩ Y ∩ Z, x the rest of X ∩ Y, y the rest of X ∩ Z, s the rest of X, t the rest of Y ∩ Z, and u the rest of Y.

                              Equations
                              • q.Euclidean = ∀ (p x y s t u : ℕ), q (y + s) (p + x) → q (x + s) (p + y) → q (x + u) (p + t)
                              Instances For

                                The only asymmetric quantifier is the empty one.

                                The only strongly connected quantifier is the universal one.

                                theorem Quantifier.NumberTree.Irreflexive.asymmetric {q : NumberTree} (hI : q.Irreflexive) (hT : ∀ (a b c : ℕ), q a c → q b c → q 0 (a + c)) :

                                An irreflexive quantifier for which Q A B and Q B A give Q A A, as transitivity requires, is asymmetric. So there is no strict partial order among the nonempty quantifiers.

                                theorem Quantifier.NumberTree.Euclidean.eq_top {q : NumberTree} (h : q.Euclidean) (hq : ∃ (a : ℕ) (b : ℕ), q a b) :
                                q = ⊤

                                A nonempty Euclidean quantifier is universal.

                                The postulates #

                                A quantifier has variety when it holds somewhere and fails somewhere.

                                Equations
                                • q.Variety = ((∃ (a : ℕ) (b : ℕ), q a b) ∧ ∃ (a : ℕ) (b : ℕ), ¬q a b)
                                Instances For

                                  A quantifier is row-convex when it meets each row of the tree in an uninterrupted stretch.

                                  Equations
                                  • q.RowConvex = ∀ ⦃a₁ b₁ a b a₂ b₂ : ℕ⦄, a₁ + b₁ = a + b → a₂ + b₂ = a + b → a₁ ≤ a → a ≤ a₂ → q a₁ b₁ → q a₂ b₂ → q a b
                                  Instances For

                                    The postulate CONT asks that both the presence and the absence of the quantifier be uninterrupted along each row.

                                    Equations
                                    Instances For

                                      A quantifier has no deadlock when adding an individual to A can always keep it true.

                                      Equations
                                      • q.NoDeadlock = ∀ ⦃a b : ℕ⦄, q a b → q (a + 1) b ∨ q a (b + 1)
                                      Instances For

                                        The postulate PLUS asks that neither the truth nor the falsity of the quantifier reach a deadlock.

                                        Equations
                                        Instances For

                                          A quantifier is homogeneous when adding an individual to A has the same two outcomes wherever the quantifier holds.

                                          Equations
                                          • q.Homogeneous = ∀ ⦃a₁ b₁ a₂ b₂ : ℕ⦄, q a₁ b₁ → q a₂ b₂ → (q (a₁ + 1) b₁ ↔ q (a₂ + 1) b₂) ∧ (q a₁ (b₁ + 1) ↔ q a₂ (b₂ + 1))
                                          Instances For

                                            The postulate UNIF asks that adding an individual have the same outcomes wherever the quantifier holds, and the same outcomes wherever it fails.

                                            Equations
                                            Instances For

                                              The square of opposition #

                                              The four corners are the only quantifiers with variety that satisfy CONT, PLUS and UNIF.

                                              The quantifiers with variety that satisfy CONT, PLUS and UNIF are exactly all, some, no and not all.

                                              theorem Quantifier.NumberTree.not_uniform_two_le :
                                              ¬Uniform fun (x b : ℕ) => 2 ≤ b

                                              The quantifier at least two is not uniform. Adding an individual to A ∩ B leaves it false at (0, 0) and makes it true at (0, 1).

                                              Additivity #

                                              A quantifier is additive when its points are closed under coordinatewise addition.

                                              Equations
                                              • q.Additive = ∀ ⦃a b a' b' : ℕ⦄, q a b → q a' b' → q (a + a') (b + b')
                                              Instances For

                                                The tree of a generalized quantifier #

                                                A generalized quantifier counts its arguments with Set.ncard, which asks for no decidability; the counts are meaningful when the sets are finite.

                                                def Quantifier.GQ.Quantity {α : Type u_1} (q : GQ α) :

                                                A quantifier has quantity when Q(A, B) depends only on the four cardinalities |A ∩ B|, |A \ B|, |B \ A| and |M \ (A ∪ B)|.

                                                Equations
                                                • One or more equations did not get rendered due to their size.
                                                Instances For
                                                  theorem Quantifier.GQ.QuantityInvariant.quantity {α : Type u_1} {Q : GQ α} [Finite α] (hQ : Q.QuantityInvariant) :

                                                  On a finite universe a permutation-invariant quantifier has quantity, since equal cell cardinalities give a permutation carrying each cell of one pair onto the same cell of the other.

                                                  A quantifier with quantity is permutation invariant, since a permutation preserves the cardinality of each cell.

                                                  theorem Quantifier.GQ.iff_of_ncard_eq {α : Type u_1} {Q : GQ α} {A B A' B' : α → Prop} [Finite α] (hC : Q.Conservative) (hQ : Q.QuantityInvariant) (hd : {x : α | A x ∧ ¬B x}.ncard = {x : α | A' x ∧ ¬B' x}.ncard) (hi : {x : α | A x ∧ B x}.ncard = {x : α | A' x ∧ B' x}.ncard) :
                                                  Q A B ↔ Q A' B'

                                                  A conservative, permutation-invariant quantifier on a finite universe holds of A and B according to |A \ B| and |A ∩ B| alone.

                                                  def Quantifier.NumberTree.ofGQ {α : Type u_1} (Q : GQ α) :

                                                  The tree of a generalized quantifier holds of (a, b) when the quantifier holds of some A and B with |A \ B| = a and |A ∩ B| = b.

                                                  Equations
                                                  Instances For
                                                    theorem Quantifier.NumberTree.ofGQ_iff {α : Type u_1} {Q : GQ α} [Finite α] (hC : Q.Conservative) (hQ : Q.QuantityInvariant) (A B : α → Prop) :
                                                    ofGQ Q {x : α | A x ∧ ¬B x}.ncard {x : α | A x ∧ B x}.ncard ↔ Q A B

                                                    A conservative, permutation-invariant quantifier on a finite universe holds of A and B exactly when its tree holds of |A \ B| and |A ∩ B|.

                                                    def Quantifier.NumberTree.toGQ {α : Type u_1} (q : NumberTree) :
                                                    GQ α

                                                    The quantifier of a tree holds of A and B when the tree holds of |A \ B| and |A ∩ B|.

                                                    Equations
                                                    • q.toGQ A B = q {x : α | A x ∧ ¬B x}.ncard {x : α | A x ∧ B x}.ncard
                                                    Instances For
                                                      theorem Quantifier.NumberTree.toGQ_apply {α : Type u_1} (q : NumberTree) (A B : α → Prop) :
                                                      q.toGQ A B ↔ q {x : α | A x ∧ ¬B x}.ncard {x : α | A x ∧ B x}.ncard
                                                      @[simp]
                                                      theorem Quantifier.NumberTree.toGQ_inf {α : Type u_1} (q r : NumberTree) :
                                                      (q ⊓ r).toGQ = q.toGQ ⊓ r.toGQ
                                                      @[simp]
                                                      @[simp]

                                                      The quantifier of a tree's inner negation is the inner negation of its quantifier.

                                                      @[instance_reducible]
                                                      instance Quantifier.NumberTree.toGQ.decidable {α : Type u_1} [Fintype α] (q : NumberTree) [DecidableRel q] (A B : α → Prop) [DecidablePred A] [DecidablePred B] :
                                                      Decidable (q.toGQ A B)

                                                      On a finite universe the quantifier of a decidable tree is decidable at decidable arguments.

                                                      Equations

                                                      The quantifier of a tree is conservative, since A \ B and A ∩ B see only B ∩ A.

                                                      The quantifier of a tree has quantity, depending on two of the four cells.

                                                      The quantifier of a tree is permutation invariant.

                                                      The quantifier of a scope-monotone tree is scope monotone, since enlarging B within A moves |A \ B ∩ B'| individuals from A \ B to A ∩ B.

                                                      The quantifier of a scope-antitone tree is scope antitone.

                                                      Counting quantifiers #

                                                      def Quantifier.NumberTree.points (n : ℕ) :
                                                      Finset ((_ : ℕ) × ℕ × ℕ)

                                                      The points of rows 0 to n of the tree, each given with its row.

                                                      Equations
                                                      Instances For
                                                        theorem Quantifier.NumberTree.card_points (n : ℕ) :
                                                        (points n).card = (n + 1) * (n + 2) / 2
                                                        theorem Quantifier.NumberTree.card_powerset_points (n : ℕ) :
                                                        (points n).powerset.card = 2 ^ ((n + 1) * (n + 2) / 2)

                                                        The conservative, permutation-invariant quantifiers on a universe of n individuals are the sets of points in rows 0 to n of the tree.

                                                        Constant rows and the individuals a quantifier depends on #

                                                        A quantifier is constant on the n-th row when whether it holds of an n-element restrictor does not depend on the scope.

                                                        Equations
                                                        • q.ConstantOnRow n = ∀ (a b a' b' : ℕ), a + b = n → a' + b' = n → (q a b ↔ q a' b')
                                                        Instances For

                                                          A quantifier is constant on rows 0 to n when, on a universe of n individuals, it does not depend on its arguments at all.

                                                          Equations
                                                          • q.ConstantBelow n = ∀ (a b a' b' : ℕ), a + b ≤ n → a' + b' ≤ n → (q a b ↔ q a' b')
                                                          Instances For
                                                            theorem Quantifier.NumberTree.not_constantOnRow_iff {q : NumberTree} {n : ℕ} :
                                                            ¬q.ConstantOnRow n ↔ ∃ (a : ℕ) (b : ℕ), a + b + 1 = n ∧ ¬(q (a + 1) b ↔ q a (b + 1))

                                                            A row is constant unless two adjacent points of it differ.

                                                            theorem Quantifier.NumberTree.not_constantBelow_iff {q : NumberTree} {n : ℕ} :
                                                            ¬q.ConstantBelow n ↔ ∃ (a : ℕ) (b : ℕ), a + b + 1 ≤ n ∧ (¬(q (a + 1) b ↔ q a b) ∨ ¬(q a (b + 1) ↔ q a b))

                                                            Rows 0 to n are constant unless two adjacent points among them differ.

                                                            theorem Quantifier.NumberTree.toGQ_some_iff {α : Type u_1} [Finite α] {A B : α → Prop} :
                                                            NumberTree.some.toGQ A B ↔ ∃ (x : α), A x ∧ B x
                                                            theorem Quantifier.NumberTree.toGQ_no_iff {α : Type u_1} [Finite α] {A B : α → Prop} :
                                                            NumberTree.no.toGQ A B ↔ ¬∃ (x : α), A x ∧ B x
                                                            theorem Quantifier.NumberTree.toGQ_all_iff {α : Type u_1} [Finite α] {A B : α → Prop} :
                                                            NumberTree.all.toGQ A B ↔ ∀ (x : α), A x → B x
                                                            theorem Quantifier.NumberTree.dependsOn_toGQ_compl_singleton_iff {q : NumberTree} {α : Type u_1} [Finite α] (A : α → Prop) (e : α) :
                                                            DependsOn (q.toGQ A) {e}ᶜ ↔ A e → q.ConstantOnRow {x : α | A x}.ncard

                                                            The quantifier of a tree depends on whether an individual is in its scope only if the individual is in its restrictor and the tree is not constant on the restrictor's row.

                                                            theorem Quantifier.NumberTree.exists_not_dependsOn_toGQ_restrictor_iff {q : NumberTree} {α : Type u_1} [Finite α] (e : α) :
                                                            (∃ (B : α → Prop), ¬DependsOn (fun (A : α → Prop) => q.toGQ A B) {e}ᶜ) ↔ ¬q.ConstantBelow (Nat.card α)

                                                            The quantifier of a tree, as a function of its restrictor, depends for some scope on whether an individual is in the restrictor iff the tree is not constant below the size of the universe.