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:
Equations
- Sensitivity.instInhabitedQ n = inferInstanceAs (Inhabited (Fin n → Bool))
 
Equations
- Sensitivity.instFintypeQ n = inferInstanceAs (Fintype (Fin n → Bool))
 
n will always denote a natural number.
Q 0 has a unique element.
Equations
- Sensitivity.Q.instUniqueOfNatNat = { default := fun (x : Fin 0) => true, uniq := Sensitivity.Q.instUniqueOfNatNat._proof_1 }
 
Until the end of this namespace, n will be an implicit argument (still
a natural number).
In Q 0, no two vertices are adjacent.
The vector space #
The free vector space on vertices of a hypercube, defined inductively.
Equations
- Sensitivity.V 0 = ℝ
 - Sensitivity.V n.succ = (Sensitivity.V n × Sensitivity.V n)
 
Instances For
V n is a real vector space whose equality relation is computable.
Equations
- Sensitivity.V.instDecidableEq n = Nat.recAux (id inferInstance) (fun (n : ℕ) (a : DecidableEq (Sensitivity.V n)) => id inferInstance) n
 
Equations
- Sensitivity.V.instAddCommGroup n = Nat.recAux (id inferInstance) (fun (n : ℕ) (a : AddCommGroup (Sensitivity.V n)) => id inferInstance) n
 
Equations
- Sensitivity.V.instModuleReal n = Nat.recAux (id inferInstance) (fun (n : ℕ) (a : Module ℝ (Sensitivity.V n)) => id inferInstance) n
 
The basis of V indexed by the hypercube, defined inductively.
Equations
- Sensitivity.e = fun (x : Sensitivity.Q 0) => 1
 - Sensitivity.e = fun (x : Sensitivity.Q n.succ) => bif x 0 then (Sensitivity.e (Sensitivity.π x), 0) else (0, Sensitivity.e (Sensitivity.π x))
 
Instances For
The dual basis to e, defined inductively.
Equations
- One or more equations did not get rendered due to their size.
 - Sensitivity.ε x_2 = LinearMap.id
 
Instances For
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
The linear map #
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
- Sensitivity.f 0 = 0
 - Sensitivity.f n.succ = ((Sensitivity.f n).coprod LinearMap.id).prod (LinearMap.id.coprod (-Sensitivity.f n))
 
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.
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.
The linear operator $g_m$ corresponding to Knuth's matrix $B_m$.
Equations
- Sensitivity.g m = (Sensitivity.f m + √(↑m + 1) • LinearMap.id).prod LinearMap.id
 
Instances For
In the following lemmas, m will denote a natural number.
Again we unpack what are the values of g.
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).
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.