LEMMA 2 — Pr[X_i = R_j and X_i′ = R_j′] = n_ij·n_i′j′/q² for i ≠ i′
ProvedLubyMIS.Derandomized.lemma2Let be a prime with and let be an matrix with entries in a set . On the sample space with the uniform law, let . For distinct rows and values ,
Together with Lemma 1 this says that are pairwise independent on a sample space of only points.
Formalization Note The page does not state , but the identity is false for and (the left side is ), and the page's proof uses that ; the hypothesis is added. Since when , distinct rows have distinct residues mod .
import Mathlib import Definitions.Def_LubyMIS_Derandomized_SampleSpace
namespace LubyMIS.Derandomized
/-- LEMMA 2 (Luby 1986, §4.2, p. 1045). On the `q²`-point sample space of §4.2, with the uniform law,
for distinct vertices `i ≠ i′`: `Pr[X_i = R_j and X_{i′} = R_{j′}] = n_{ij} n_{i′j′} / q²`. -/
theorem lemma2 (q : ℕ) [Fact q.Prime] (n : ℕ) (hnq : n ≤ q) {R : Type*} [DecidableEq R]
(A : Fin n → ZMod q → R) (i i' : Fin n) (hii' : i ≠ i') (r r' : R) :
((Finset.univ.filter (fun p : ZMod q × ZMod q => Xrv A i p = r ∧ Xrv A i' p = r')).card : ℝ) /
(q : ℝ) ^ 2 =
((nCount A i r : ℝ) * (nCount A i' r' : ℝ)) / (q : ℝ) ^ 2 := by sorry
end LubyMIS.Derandomized
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Let be a prime and a natural number. Let be any type with decidable equality, and let be rows for . Take two distinct labels and values .
The statement asserts
where is reduction mod and . Because both sides have the same denominator , this is equivalent to the count identity
Degenerate cases:
- If , no two distinct labels exist and the statement is vacuous.
- is allowed.
- If either value is absent from its row, both sides are .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.