Documentation

Archive.Sensitivity

Huang's sensitivity theorem #

A formalization of Hao Huang's sensitivity theorem: in the hypercube of dimension n ≥ 1, if one colors more than half the vertices then at least one vertex has at least √n colored neighbors.

A fun summer collaboration by Reid Barton, Johan Commelin, Jesse Michael Han, Chris Hughes, Robert Y. Lewis, and Patrick Massot, based on Don Knuth's account of the story (https://www.cs.stanford.edu/~knuth/papers/huang.pdf), using the Lean theorem prover (https://leanprover.github.io/), by Leonardo de Moura at Microsoft Research, and his collaborators (https://leanprover.github.io/people/), and using Lean's user maintained mathematics library (https://github.com/leanprover-community/mathlib).

The project was developed at https://github.com/leanprover-community/lean-sensitivity and is now archived at https://github.com/leanprover-community/mathlib/blob/master/archive/sensitivity.lean

The next two lines assert we do not want to give a constructive proof, but rather use classical logic.

The hypercube #

Notations:

The hypercube in dimension n.

Equations
Instances For
    def Sensitivity.π {n : } :
    Q n.succQ n

    The projection from Q n.succ to Q n forgetting the first value (ie. the image of zero).

    Equations
    Instances For
      theorem Sensitivity.Q.ext {n : } {f g : Q n} (h : ∀ (x : Fin n), f x = g x) :
      f = g

      n will always denote a natural number.

      Q 0 has a unique element.

      Equations
      theorem Sensitivity.Q.card (n : ) :
      Fintype.card (Q n) = 2 ^ n

      Q n has 2^n elements.

      Until the end of this namespace, n will be an implicit argument (still a natural number).

      theorem Sensitivity.Q.succ_n_eq {n : } (p q : Q n.succ) :
      p = q p 0 = q 0 π p = π q
      def Sensitivity.Q.adjacent {n : } (p : Q n) :
      Set (Q n)

      The adjacency relation defining the graph structure on Q n: p.adjacent q if there is an edge from p to q in Q n.

      Equations
      Instances For
        theorem Sensitivity.Q.not_adjacent_zero (p q : Q 0) :
        qp.adjacent

        In Q 0, no two vertices are adjacent.

        theorem Sensitivity.Q.adj_iff_proj_eq {n : } {p q : Q n.succ} (h₀ : p 0 q 0) :
        q p.adjacent π p = π q

        If p and q in Q n.succ have different values at zero then they are adjacent iff their projections to Q n are equal.

        theorem Sensitivity.Q.adj_iff_proj_adj {n : } {p q : Q n.succ} (h₀ : p 0 = q 0) :
        q p.adjacent π q (π p).adjacent

        If p and q in Q n.succ have the same value at zero then they are adjacent iff their projections to Q n are adjacent.

        theorem Sensitivity.Q.adjacent.symm {n : } {p q : Q n} :
        q p.adjacent p q.adjacent

        The vector space #

        The free vector space on vertices of a hypercube, defined inductively.

        Equations
        Instances For
          theorem Sensitivity.V.ext {n : } {p q : V n.succ} (h₁ : p.1 = q.1) (h₂ : p.2 = q.2) :
          p = q

          V n is a real vector space whose equality relation is computable.

          noncomputable def Sensitivity.e {n : } :
          Q nV n

          The basis of V indexed by the hypercube, defined inductively.

          Equations
          Instances For
            @[simp]
            theorem Sensitivity.e_zero_apply (x : Q 0) :
            e x = 1
            noncomputable def Sensitivity.ε {n : } :
            Q nV n →ₗ[]

            The dual basis to e, defined inductively.

            Equations
            Instances For
              theorem Sensitivity.duality {n : } (p q : Q n) :
              (ε p) (e q) = if p = q then 1 else 0
              theorem Sensitivity.epsilon_total {n : } {v : V n} (h : ∀ (p : Q n), (ε p) v = 0) :
              v = 0

              Any vector in V n annihilated by all ε p's is zero.

              e and ε are dual families of vectors. It implies that e is indeed a basis and ε computes coefficients of decompositions of vectors on that basis.

              We will now derive the dimension of V, first as a cardinal in dim_V and, since this cardinal is finite, as a natural number in finrank_V

              theorem Sensitivity.dim_V {n : } :
              Module.rank (V n) = 2 ^ n

              The linear map #

              noncomputable def Sensitivity.f (n : ) :

              The linear operator $f_n$ corresponding to Huang's matrix $A_n$, defined inductively as a ℝ-linear map from V n to V n.

              Equations
              Instances For

                The preceding definition uses linear map constructions to automatically get that f is linear, but its values are somewhat buried as a side-effect. The next two lemmas unbury them.

                @[simp]
                theorem Sensitivity.f_zero :
                f 0 = 0
                theorem Sensitivity.f_succ_apply {n : } (v : V n.succ) :
                (f n.succ) v = ((f n) v.1 + v.2, v.1 - (f n) v.2)

                In the next statement, the explicit conversion (n : ℝ) of n to a real number is necessary since otherwise n • v refers to the multiplication defined using only the addition of V.

                theorem Sensitivity.f_squared {n : } (v : V n) :
                (f n) ((f n) v) = n v

                We now compute the matrix of f in the e basis (p is the line index, q the column index).

                theorem Sensitivity.f_matrix {n : } (p q : Q n) :
                |(ε q) ((f n) (e p))| = if p q.adjacent then 1 else 0
                noncomputable def Sensitivity.g (m : ) :
                V m →ₗ[] V m.succ

                The linear operator $g_m$ corresponding to Knuth's matrix $B_m$.

                Equations
                Instances For

                  In the following lemmas, m will denote a natural number.

                  Again we unpack what are the values of g.

                  theorem Sensitivity.g_apply {m : } (v : V m) :
                  (g m) v = ((f m) v + (m + 1) v, v)
                  theorem Sensitivity.f_image_g {m : } (w : V m.succ) (hv : ∃ (v : V m), (g m) v = w) :
                  (f m.succ) w = (m + 1) w

                  The main proof #

                  In this section, in order to enforce that n is positive, we write it as m + 1 for some natural number m.

                  dim X will denote the dimension of a subspace X as a cardinal.

                  fdim X will denote the (finite) dimension of a subspace X as a natural number.

                  Span S will denote the ℝ-subspace spanned by S.

                  Card X will denote the cardinal of a subset of a finite type, as a natural number.

                  In the following, and will denote intersection and sums of ℝ-subspaces, equipped with their subspace structures. The notations come from the general theory of lattices, with inf and sup (also known as meet and join).

                  theorem Sensitivity.exists_eigenvalue {m : } (H : Set (Q m.succ)) (hH : H.toFinset.card 2 ^ m + 1) :
                  ySubmodule.span (e '' H) LinearMap.range (g m), y 0

                  If a subset H of Q (m+1) has cardinal at least 2^m + 1 then the subspace of V (m+1) spanned by the corresponding basis vectors non-trivially intersects the range of g m.

                  theorem Sensitivity.huang_degree_theorem {m : } (H : Set (Q m.succ)) (hH : H.toFinset.card 2 ^ m + 1) :
                  qH, (m + 1) (H q.adjacent).toFinset.card

                  Huang sensitivity theorem also known as the Huang degree theorem