Documentation

CslibFrontier.Foundations.Combinatorics.RectangleFreeMatrix

Rectangle-free Boolean matrices and the 2-rectangle lift #

A Boolean matrix A : Matrix α β Bool has weight boolMatrixWeight A, the number of its true entries, and is k-rectangle-free (IsRectangleFreeMatrix A k, or k-free) when no k-element row set I and k-element column set J form an all-true submatrix I × J.

Given A : Matrix α β Bool, its 2-rectangle lift twoRectMatrix A is indexed by 2-element subsets {r : Finset α // #r = 2} and {c : Finset β // #c = 2}, with entry (r, c) equal to true precisely when r × c is an all-true 2 × 2 submatrix of A. Following Sergeev ([Ser14], Lemmas 1 and 2, p. 2):

Main definitions #

Main results #

References #

def Cslib.boolMatrixWeight {α : Type u_1} {β : Type u_2} [Fintype α] [Fintype β] (A : Matrix α β Bool) :

The weight |A| of a finite Boolean matrix A: the number of entries equal to true.

The weight of a Boolean matrix is at most the total number of entries.

theorem Cslib.boolMatrixWeight_add_compl {α : Type u_1} {β : Type u_2} [Fintype α] [Fintype β] (A : Matrix α β Bool) :

The weights of a Boolean matrix and its entrywise negation sum to |α| * |β|.

theorem Cslib.boolMatrixWeight_eq_sum_row {α : Type u_1} {β : Type u_2} [Fintype α] [Fintype β] (A : Matrix α β Bool) :
boolMatrixWeight A = ∑ i : α, {j : β | A i j = true}.card

The weight of a Boolean matrix equals the sum of its row weights.

theorem Cslib.boolMatrixWeight_reindex {α : Type u_1} {β : Type u_2} {α' : Type u_3} {β' : Type u_4} [Fintype α] [Fintype β] [Fintype α'] [Fintype β'] (e₁ : α ≃ α') (e₂ : β ≃ β') (A : Matrix α β Bool) :

Reindexing rows and columns by equivalences preserves Boolean matrix weight.

def Cslib.IsRectangleFreeMatrix {α : Type u_1} {β : Type u_2} (A : Matrix α β Bool) (k : ℕ) :

A Boolean matrix A is k-rectangle-free (k-free) if no k rows and k columns form an all-true k × k submatrix ([Ser14], p. 1).

theorem Cslib.IsRectangleFreeMatrix.pos {α : Type u_1} {β : Type u_2} {A : Matrix α β Bool} {k : ℕ} (hA : IsRectangleFreeMatrix A k) :
0 < k

Every k-free matrix has 0 < k, since the empty 0 × 0 submatrix is vacuously all-true.

A 1-free finite Boolean matrix has weight 0.

theorem Cslib.IsRectangleFreeMatrix.mono {α : Type u_1} {β : Type u_2} {A : Matrix α β Bool} {k k' : ℕ} (hA : IsRectangleFreeMatrix A k) (hk : k ≤ k') :

Monotonicity in the rectangle threshold: a k-free matrix is k'-free for all k ≤ k'.

theorem Cslib.isRectangleFreeMatrix_reindex {α : Type u_1} {β : Type u_2} {α' : Type u_3} {β' : Type u_4} (e₁ : α ≃ α') (e₂ : β ≃ β') (A : Matrix α β Bool) (k : ℕ) :

Reindexing rows and columns preserves k-rectangle-freeness.

theorem Cslib.card_twoSubsets {α : Type u_1} [Fintype α] :

The number of 2-element subsets of a finite type α is C(|α|, 2).

def Cslib.twoRectMatrix {α : Type u_1} {β : Type u_2} (A : Matrix α β Bool) :
Matrix { r : Finset α // r.card = 2 } { c : Finset β // c.card = 2 } Bool

Sergeev's 2-rectangle lift of A : Matrix α β Bool, indexed by 2-element subsets of α and β, with entry (r, c) equal to true iff r × c is an all-true 2 × 2 submatrix of A ([Ser14], p. 2).

@[simp]
theorem Cslib.twoRectMatrix_apply {α : Type u_1} {β : Type u_2} (A : Matrix α β Bool) (r : { r : Finset α // r.card = 2 }) (c : { c : Finset β // c.card = 2 }) :
twoRectMatrix A r c = true ↔ ∀ i ∈ ↑r, ∀ j ∈ ↑c, A i j = true

Entry characterization of twoRectMatrix.

theorem Cslib.mul_sub_le_two_mul_choose_mul_boolMatrixWeight_twoRectMatrix {α : Type u_1} {β : Type u_2} [Fintype α] [Fintype β] (A : Matrix α β Bool) {d : ℕ} (hd : ∀ (i : α), d ≤ {j : β | A i j = true}.card) :

If every row of A : Matrix α β Bool has at least d entries equal to true, then (|α| * C(d, 2)) * (|α| * C(d, 2) - C(|β|, 2)) ≤ 2 * C(|β|, 2) * boolMatrixWeight (twoRectMatrix A).

Sergeev's Lemma 1 ([Ser14], p. 2): every m × m Boolean matrix A (m = |α|) with weight |A| ≥ 2 m^{3/2} (stated in exact integer form as 4 * m ^ 3 ≤ |A| ^ 2) satisfies |A| ^ 4 ≤ 32 * m ^ 4 * boolMatrixWeight (twoRectMatrix A).

Sergeev's Lemma 2 ([Ser14], p. 2): if A : Matrix α β Bool is k-free, then its 2-rectangle lift twoRectMatrix A is (C(k - 1, 2) + 1)-free.