wild_normalized_array_six_seal_second_factorial_bound
For every normalized symmetric idempotent row-injective array on Fin n, let mu(S) count colors outside a six-set S whose matching edges preserve S. The sum over all six-sets of mu(S)*(mu(S)-1) is at most n*(n-1)*floor((n-3)/6). This is a multiplicity bound for six-supports, not a probability bound or an independence claim.
Statement
theorem wild_normalized_array_six_seal_second_factorial_bound (n : ℕ) (A : Fin n → Fin n → Fin n) (hdiag : ∀ x, A x x = x) (hsymm : ∀ x y, A x y = A y x) (hinj : ∀ x, Function.Injective (A x)) : let mu : Finset (Fin n) → ℕ := fun S => (univ.filter fun i : Fin n => i ∉ S ∧ ∀ x ∈ S, ∀ y, A x y = i → y ∈ S).card ∑ S ∈ (univ : Finset (Fin n)).powersetCard 6, mu S * (mu S - 1) ≤ n * (n-1) * ((n-3)/6)
- Source
- IN-374 / OP-306, dependence estimates for the weighted partition route to https://arxiv.org/html/2610.22142v1. Elementary matching support consequence of the standard even-cycle decomposition of two disjoint perfect matchings; matching background https://dspacemainprd01.lib.uwaterloo.ca/server/api/core/bitstreams/9d33772f-c7dc-409f-a4ed-521da8d87890/content . Exact experiment9362 audits six saved15 arrays and cyclic9,13,21,27,39,61. No new wild-number bound, sharpness case or research advance is claimed.
- Verified
- 30 Oct 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 3
- wild_normalized_array_common_six_seals_boundFor a symmetric idempotent row-injective array A on Fin n and two distinct colors a,b, let F consist of six-element sets S excluding a,b…
- LinearOrder.toTotalPreorderEvery
LinearOrderis aTotalPreorder. - TotalPreorderA total preorder: a preorder where
≤is total (complete). This is weaker thanLinearOrder— it does NOT require antisymmetry or…
The proof, explained
The bound is proved by double counting ordered pairs of distinct colors (a, b) preserved by 6-sets S. First, the falling factorial μ(S)(μ(S) - 1) is rewritten as the number of distinct pairs (a, b) such that S seals both a and b. Interchanging the order of summation expresses the total sum as ∑ a, ∑ b, g a b, where g a b counts 6-sets simultaneously sealing a and b. By a known multiplicity bound for common 6-seals, g a b ≤ (n - 3) / 6 for a ≠ b, while g a a = 0. Summing this bound over all n(n - 1) off-diagonal pairs yields the desired bound n(n - 1) * ((n - 3) / 6).
The falling factorial |T|(|T| - 1) equals the number of ordered pairs of distinct elements in T, written as ∑ a ∈ T, ∑ b ∈ T \ {a}, 1.
For each a ∈ T, removing a leaves |T| - 1 elements by card_erase_of_mem. Summing the constant 1 over T \ {a} gives |T| - 1, and summing this constant over all a ∈ T produces |T|(|T| - 1) by sum_const.
uses
sum_congr,card_erase_of_mem,sum_consthave h1 : T.card * (T.card - 1) = ∑ a ∈ T, ∑ b ∈ T.erase a, 1 := by have h1' : (∑ a ∈ T, ∑ _b ∈ T.erase a, (1 : ℕ)) = ∑ a ∈ T, (T.card - 1) := by apply sum_congr rfl intro a ha simp [card_erase_of_mem ha] rw [h1'] simp [sum_const]
For any a, the inner sum ∑ b ∈ univ, [a ≠ b ∧ a ∈ T ∧ b ∈ T] equals ∑ b ∈ T \ {a}, 1 when a ∈ T, and equals 0 when a ∉ T.
We split on whether a ∈ T. If a ∈ T, the condition a ≠ b ∧ a ∈ T ∧ b ∈ T is equivalent to b ∈ T \ {a} by mem_erase and ne_comm. Rewriting the if-condition with if_congr and converting the indicator sum into a filtered sum over the universe yields the sum over T \ {a} via filter_mem_eq_of_subset. If a ∉ T, the condition is identically false, so each summand is 0 and the sum vanishes by sum_const_zero.
uses
mem_erase,ne_comm,if_congr,sum_filter,filter_mem_eq_of_subset,subset_univ,sum_const_zerohave hinner : ∀ a, (∑ b ∈ (univ : Finset α), (if a ≠ b ∧ a ∈ T ∧ b ∈ T then (1 : ℕ) else 0)) = if a ∈ T then ∑ b ∈ T.erase a, 1 else 0 := by intro a split_ifs with ha · have hrew : (fun b => (if a ≠ b ∧ a ∈ T ∧ b ∈ T then (1 : ℕ) else 0)) = fun b => (if b ∈ T.erase a then (1 : ℕ) else 0) := by ext b have : (a ≠ b ∧ a ∈ T ∧ b ∈ T) ↔ b ∈ T.erase a := by simp [mem_erase, ha, ne_comm] rw [if_congr this rfl rfl] rw [hrew, ← sum_filter, filter_mem_eq_of_subset (subset_univ _)] · have hrew : (fun b => (if a ≠ b ∧ a ∈ T ∧ b ∈ T then (1 : ℕ) else 0)) = fun _ => 0 := by ext b have : ¬(a ≠ b ∧ a ∈ T ∧ b ∈ T) := by simp [ha] simp [this] rw [hrew, sum_const_zero]
For any finite set T, |T|(|T| - 1) = ∑ a ∈ univ, ∑ b ∈ univ, if a ≠ b ∧ a ∈ T ∧ b ∈ T then 1 else 0.
Substituting the inner sum characterization into the double sum turns the outer sum into an indicator for a ∈ T of the sum over T \ {a}. By sum_filter and filter_mem_eq_of_subset, this outer sum over the universe equals the sum over a ∈ T, matching the formula |T|(|T| - 1) established previously.
uses
sum_filter,filter_mem_eq_of_subset,subset_univsimp_rw [hinner] rw [h1] rw [← sum_filter, filter_mem_eq_of_subset (subset_univ _)]
For any fixed a, the row sum ∑ b ∈ univ, g a b is at most (n - 1) * ((n - 3) / 6).
By sum_erase_add, the sum over all b splits into g a a and the sum over b ∈ univ \ {a}. Since g a a = 0 by hypothesis, this leaves the sum over the n - 1 off-diagonal elements. Because each off-diagonal entry satisfies g a b ≤ (n - 3) / 6, bounding each term with sum_le_sum gives (n - 1) * ((n - 3) / 6).
uses
sum_erase_add,mem_univ,add_zero,sum_le_sum,mem_erase,card_erase_of_memhave hinner : ∀ a : Fin n, ∑ b ∈ (univ : Finset (Fin n)), g a b ≤ (n - 1) * ((n - 3) / 6) := by intro a have hsum := sum_erase_add (univ : Finset (Fin n)) (g a) (mem_univ a) rw [hzero a, add_zero] at hsum rw [← hsum] have hle : ∑ b ∈ (univ : Finset (Fin n)).erase a, g a b ≤ ∑ _b ∈ (univ : Finset (Fin n)).erase a, ((n - 3) / 6) := by apply sum_le_sum intro b hb exact hbound a b (mem_erase.mp hb).1.symm apply hle.trans simp [card_erase_of_mem]
The total double sum ∑ a, ∑ b, g a b is bounded by n * (n - 1) * ((n - 3) / 6).
Summing the row bound over all n choices of a ∈ univ using sum_le_sum gives n copies of (n - 1) * ((n - 3) / 6), which simplifies by associativity of multiplication (mul_assoc).
uses
sum_le_sum,mul_assochave houter : ∑ a ∈ (univ : Finset (Fin n)), ∑ b ∈ (univ : Finset (Fin n)), g a b ≤ ∑ _a ∈ (univ : Finset (Fin n)), ((n - 1) * ((n - 3) / 6)) := sum_le_sum (fun a _ => hinner a) apply houter.trans simp [mul_assoc]
The sum ∑ S, μ(S)(μ(S) - 1) is expressed as the triple sum ∑ S, ∑ a, ∑ b, if a ≠ b ∧ a ∈ C S ∧ b ∈ C S then 1 else 0.
Let C(S) denote the set of colors outside S whose matching edges stay within S, so μ(S) = |C(S)|. Applying the pair-counting identity wild_normalized_array_six_seal_second_factorial_bound_card_mul_sub_one to C(S) rewrites each term μ(S)(μ(S) - 1) as the double sum of the indicator that a, b ∈ C(S) are distinct.
uses
sum_congr,wild_normalized_array_six_seal_second_factorial_bound_card_mul_sub_oneintro mu let C : Finset (Fin n) → Finset (Fin n) := fun S => univ.filter fun i => i ∉ S ∧ ∀ x ∈ S, ∀ y, A x y = i → y ∈ S have hmu : ∀ S, mu S = (C S).card := fun _ => rfl have hstep1 : (∑ S ∈ (univ : Finset (Fin n)).powersetCard 6, mu S * (mu S - 1)) = ∑ S ∈ (univ : Finset (Fin n)).powersetCard 6, ∑ a ∈ (univ : Finset (Fin n)), ∑ b ∈ (univ : Finset (Fin n)), if a ≠ b ∧ a ∈ C S ∧ b ∈ C S then 1 else 0 := by apply sum_congr rfl intro S _ rw [hmu S, wild_normalized_array_six_seal_second_factorial_bound_card_mul_sub_one (C S)] rw [hstep1]
The order of summation can be interchanged to place the sum over pairs (a, b) on the outside.
Applying sum_comm twice interchanges the outer sum over 6-sets S with the inner sums over a and b.
uses
sum_comm,sum_congrhave hswap : (∑ S ∈ (univ : Finset (Fin n)).powersetCard 6, ∑ a ∈ (univ : Finset (Fin n)), ∑ b ∈ (univ : Finset (Fin n)), if a ≠ b ∧ a ∈ C S ∧ b ∈ C S then 1 else 0) = ∑ a ∈ (univ : Finset (Fin n)), ∑ b ∈ (univ : Finset (Fin n)), ∑ S ∈ (univ : Finset (Fin n)).powersetCard 6, if a ≠ b ∧ a ∈ C S ∧ b ∈ C S then 1 else 0 := by rw [sum_comm] apply sum_congr rfl intro a _ rw [sum_comm] rw [hswap]
Defining g a b as the inner sum over 6-sets S, the diagonal entries vanish: g a a = 0 for all a.
When a = b, the condition a ≠ a is false, so every indicator term in the sum is 0. Summing 0 over all 6-sets yields 0 by sum_const_zero.
uses
sum_const_zerolet g : Fin n → Fin n → ℕ := fun a b => ∑ S ∈ (univ : Finset (Fin n)).powersetCard 6, if a ≠ b ∧ a ∈ C S ∧ b ∈ C S then 1 else 0 have hzero : ∀ a, g a a = 0 := by intro a dsimp [g] have : (fun S => (if a ≠ a ∧ a ∈ C S ∧ a ∈ C S then (1 : ℕ) else 0)) = fun _ => 0 := by ext S simp rw [this, sum_const_zero]
For a ≠ b, a ∈ C S and b ∈ C S if and only if a, b ∉ S and every matching edge of color a or b incident to S has both endpoints in S.
By definition of C(S), a ∈ C(S) means a ∉ S and edges of color a preserve S, while b ∈ C(S) means b ∉ S and edges of color b preserve S. Combining these two universal implications into one over the disjunction A x y = a ∨ A x y = b gives the stated equivalence.
uses
mem_filter,mem_univ,true_and,Or.inl,Or.inrhave hbound : ∀ a b, a ≠ b → g a b ≤ (n - 3) / 6 := by intro a b hab dsimp [g] have hiff : ∀ S, (a ≠ b ∧ a ∈ C S ∧ b ∈ C S) ↔ (a ∉ S ∧ b ∉ S ∧ ∀ x ∈ S, ∀ y, A x y = a ∨ A x y = b → y ∈ S) := by intro S dsimp [C] simp only [mem_filter, mem_univ, true_and] constructor · rintro ⟨_, ⟨ha1, ha2⟩, ⟨hb1, hb2⟩⟩ refine ⟨ha1, hb1, fun x hx y hy => ?_⟩ rcases hy with hya | hyb · exact ha2 x hx y hya · exact hb2 x hx y hyb · rintro ⟨ha1, hb1, h⟩ refine ⟨hab, ⟨ha1, fun x hx y hya => h x hx y (Or.inl hya)⟩, ⟨hb1, fun x hx y hyb => h x hx y (Or.inr hyb)⟩⟩
For a ≠ b, g a b equals the number of 6-sets S that seal both color a and color b.
Using the logical equivalence hiff, if_congr replaces the indicator condition in g a b with the joint seal condition. Rewriting with sum_filter converts this indicator sum into the cardinality of the subcollection of 6-sets sealing both colors.
uses
if_congr,sum_filterhave hrew : (∑ S ∈ (univ : Finset (Fin n)).powersetCard 6, if a ≠ b ∧ a ∈ C S ∧ b ∈ C S then 1 else 0) = (((univ : Finset (Fin n)).powersetCard 6).filter fun S => a ∉ S ∧ b ∉ S ∧ ∀ x ∈ S, ∀ y, A x y = a ∨ A x y = b → y ∈ S).card := by have h1 : (fun S => (if a ≠ b ∧ a ∈ C S ∧ b ∈ C S then (1 : ℕ) else 0)) = fun S => if (a ∉ S ∧ b ∉ S ∧ ∀ x ∈ S, ∀ y, A x y = a ∨ A x y = b → y ∈ S) then 1 else 0 := by ext S rw [if_congr (hiff S) rfl rfl] rw [h1, ← sum_filter] simp rw [hrew]
For any a ≠ b, g a b ≤ (n - 3) / 6.
The lemma wild_normalized_array_common_six_seals_bound states that 6 * g a b ≤ n - 3. Since 6 > 0, integer division arithmetic (Nat.le_div_iff_mul_le) translates this into g a b ≤ (n - 3) / 6.
uses
wild_normalized_array_common_six_seals_bound,Nat.le_div_iff_mul_lehave hb := wild_normalized_array_common_six_seals_bound n A hdiag hsymm hinj a b hab have hpos : 0 < 6 := by decide rw [Nat.le_div_iff_mul_le hpos] linarith
The sum of μ(S)(μ(S) - 1) over all 6-sets is at most n * (n - 1) * ((n - 3) / 6).
We apply the helper theorem wild_normalized_array_six_seal_second_factorial_bound_sum_pairs to g, using the diagonal vanishing property hzero and the off-diagonal bound hbound.
uses
wild_normalized_array_six_seal_second_factorial_bound_sum_pairsexact wild_normalized_array_six_seal_second_factorial_bound_sum_pairs n g hzero hbound
add_zero- Adding zero to any element leaves it unchanged: a + 0 = a.
card_erase_of_mem- Removing an element a from a finite set s that contains it yields a set with cardinality |s| - 1.
filter_mem_eq_of_subset- Filtering a superset t by membership in a subset s yields s itself.
if_congr- An if-then-else expression is invariant under replacing its condition by an equivalent proposition and its branches by equal expressions.
mem_erase- An element a is in s \ {b} if and only if a ≠ b and a ∈ s.
mem_filter- An element x is in the filtered set {y ∈ s | p(y)} if and only if x ∈ s and p(x) holds.
mem_univ- Every element of a finite type belongs to the universal finset univ.
mul_assoc- Multiplication is associative: (a * b) * c = a * (b * c).
Nat.le_div_iff_mul_le- For k > 0, x ≤ y / k in natural numbers if and only if x * k ≤ y.
ne_comm- Inequality is symmetric: a ≠ b ↔ b ≠ a.
Or.inl- Constructs a proof of a ∨ b from a proof of a.
Or.inr- Constructs a proof of a ∨ b from a proof of b.
subset_univ- Every finset of elements of type α is a subset of the universal finset univ.
sum_comm- The order of summation in a double sum over two finite sets can be interchanged.
sum_congr- Two sums over equal index sets are equal if their terms agree on all elements of the index set.
sum_const- The sum of a constant c over a finite set s equals |s| * c.
sum_const_zero- The sum of zeros over any finite set is zero.
sum_erase_add- For a ∈ s, the sum of f over s equals f(a) plus the sum of f over s \ {a}.
sum_filter- The sum of f(x) over elements of s satisfying a predicate p equals the sum over s of the indicator function if p(x) then f(x) else 0.
sum_le_sum- A sum is bounded above by another sum over the same set if the inequality holds term-by-term.
true_and- The logical conjunction True ∧ p simplifies to p.
wild_normalized_array_common_six_seals_bound- For distinct colors a ≠ b, six times the number of 6-sets S disjoint from {a, b} whose matching edges into a or b stay within S is at most n - 3.
wild_normalized_array_six_seal_second_factorial_bound_card_mul_sub_one- For any finite set T, |T|(|T| - 1) equals the double sum over all pairs (a, b) of the indicator that a ≠ b, a ∈ T, and b ∈ T.
wild_normalized_array_six_seal_second_factorial_bound_sum_pairs- If g(a, a) = 0 and g(a, b) ≤ (n - 3) / 6 for all a ≠ b, then the double sum of g(a, b) over all pairs is at most n * (n - 1) * ((n - 3) / 6).
- The definitions of μ(S) and C(S) formalize the combinatorial notion of a 6-set S sealing a color outside it, meaning the 1-factor corresponding to that color does not cross between S and its complement. The division (n - 3) / 6 is natural number (floor) division.
Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.
Lean source view module on GitHub
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
open Finsettheorem wild_normalized_array_six_seal_second_factorial_bound_card_mul_sub_one {α : Type*} [Fintype α] [DecidableEq α] (T : Finset α) : T.card * (T.card - 1) = ∑ a ∈ (univ : Finset α), ∑ b ∈ (univ : Finset α), if a ≠ b ∧ a ∈ T ∧ b ∈ T then 1 else 0 := by have h1 : T.card * (T.card - 1) = ∑ a ∈ T, ∑ b ∈ T.erase a, 1 := by have h1' : (∑ a ∈ T, ∑ _b ∈ T.erase a, (1 : ℕ)) = ∑ a ∈ T, (T.card - 1) := by apply sum_congr rfl intro a ha simp [card_erase_of_mem ha] rw [h1'] simp [sum_const] have hinner : ∀ a, (∑ b ∈ (univ : Finset α), (if a ≠ b ∧ a ∈ T ∧ b ∈ T then (1 : ℕ) else 0)) = if a ∈ T then ∑ b ∈ T.erase a, 1 else 0 := by intro a split_ifs with ha · have hrew : (fun b => (if a ≠ b ∧ a ∈ T ∧ b ∈ T then (1 : ℕ) else 0)) = fun b => (if b ∈ T.erase a then (1 : ℕ) else 0) := by ext b have : (a ≠ b ∧ a ∈ T ∧ b ∈ T) ↔ b ∈ T.erase a := by simp [mem_erase, ha, ne_comm] rw [if_congr this rfl rfl] rw [hrew, ← sum_filter, filter_mem_eq_of_subset (subset_univ _)] · have hrew : (fun b => (if a ≠ b ∧ a ∈ T ∧ b ∈ T then (1 : ℕ) else 0)) = fun _ => 0 := by ext b have : ¬(a ≠ b ∧ a ∈ T ∧ b ∈ T) := by simp [ha] simp [this] rw [hrew, sum_const_zero] simp_rw [hinner] rw [h1] rw [← sum_filter, filter_mem_eq_of_subset (subset_univ _)]theorem wild_normalized_array_six_seal_second_factorial_bound_sum_pairs (n : ℕ) (g : Fin n → Fin n → ℕ) (hzero : ∀ a, g a a = 0) (hbound : ∀ a b, a ≠ b → g a b ≤ (n - 3) / 6) : ∑ a ∈ (univ : Finset (Fin n)), ∑ b ∈ (univ : Finset (Fin n)), g a b ≤ n * (n - 1) * ((n - 3) / 6) := by have hinner : ∀ a : Fin n, ∑ b ∈ (univ : Finset (Fin n)), g a b ≤ (n - 1) * ((n - 3) / 6) := by intro a have hsum := sum_erase_add (univ : Finset (Fin n)) (g a) (mem_univ a) rw [hzero a, add_zero] at hsum rw [← hsum] have hle : ∑ b ∈ (univ : Finset (Fin n)).erase a, g a b ≤ ∑ _b ∈ (univ : Finset (Fin n)).erase a, ((n - 3) / 6) := by apply sum_le_sum intro b hb exact hbound a b (mem_erase.mp hb).1.symm apply hle.trans simp [card_erase_of_mem] have houter : ∑ a ∈ (univ : Finset (Fin n)), ∑ b ∈ (univ : Finset (Fin n)), g a b ≤ ∑ _a ∈ (univ : Finset (Fin n)), ((n - 1) * ((n - 3) / 6)) := sum_le_sum (fun a _ => hinner a) apply houter.trans simp [mul_assoc]theorem wild_normalized_array_six_seal_second_factorial_bound (n : ℕ) (A : Fin n → Fin n → Fin n) (hdiag : ∀ x, A x x = x) (hsymm : ∀ x y, A x y = A y x) (hinj : ∀ x, Function.Injective (A x)) : let mu : Finset (Fin n) → ℕ := fun S => (univ.filter fun i : Fin n => i ∉ S ∧ ∀ x ∈ S, ∀ y, A x y = i → y ∈ S).card ∑ S ∈ (univ : Finset (Fin n)).powersetCard 6, mu S * (mu S - 1) ≤ n * (n-1) * ((n-3)/6) := by intro mu let C : Finset (Fin n) → Finset (Fin n) := fun S => univ.filter fun i => i ∉ S ∧ ∀ x ∈ S, ∀ y, A x y = i → y ∈ S have hmu : ∀ S, mu S = (C S).card := fun _ => rfl have hstep1 : (∑ S ∈ (univ : Finset (Fin n)).powersetCard 6, mu S * (mu S - 1)) = ∑ S ∈ (univ : Finset (Fin n)).powersetCard 6, ∑ a ∈ (univ : Finset (Fin n)), ∑ b ∈ (univ : Finset (Fin n)), if a ≠ b ∧ a ∈ C S ∧ b ∈ C S then 1 else 0 := by apply sum_congr rfl intro S _ rw [hmu S, wild_normalized_array_six_seal_second_factorial_bound_card_mul_sub_one (C S)] rw [hstep1] have hswap : (∑ S ∈ (univ : Finset (Fin n)).powersetCard 6, ∑ a ∈ (univ : Finset (Fin n)), ∑ b ∈ (univ : Finset (Fin n)), if a ≠ b ∧ a ∈ C S ∧ b ∈ C S then 1 else 0) = ∑ a ∈ (univ : Finset (Fin n)), ∑ b ∈ (univ : Finset (Fin n)), ∑ S ∈ (univ : Finset (Fin n)).powersetCard 6, if a ≠ b ∧ a ∈ C S ∧ b ∈ C S then 1 else 0 := by rw [sum_comm] apply sum_congr rfl intro a _ rw [sum_comm] rw [hswap] let g : Fin n → Fin n → ℕ := fun a b => ∑ S ∈ (univ : Finset (Fin n)).powersetCard 6, if a ≠ b ∧ a ∈ C S ∧ b ∈ C S then 1 else 0 have hzero : ∀ a, g a a = 0 := by intro a dsimp [g] have : (fun S => (if a ≠ a ∧ a ∈ C S ∧ a ∈ C S then (1 : ℕ) else 0)) = fun _ => 0 := by ext S simp rw [this, sum_const_zero] have hbound : ∀ a b, a ≠ b → g a b ≤ (n - 3) / 6 := by intro a b hab dsimp [g] have hiff : ∀ S, (a ≠ b ∧ a ∈ C S ∧ b ∈ C S) ↔ (a ∉ S ∧ b ∉ S ∧ ∀ x ∈ S, ∀ y, A x y = a ∨ A x y = b → y ∈ S) := by intro S dsimp [C] simp only [mem_filter, mem_univ, true_and] constructor · rintro ⟨_, ⟨ha1, ha2⟩, ⟨hb1, hb2⟩⟩ refine ⟨ha1, hb1, fun x hx y hy => ?_⟩ rcases hy with hya | hyb · exact ha2 x hx y hya · exact hb2 x hx y hyb · rintro ⟨ha1, hb1, h⟩ refine ⟨hab, ⟨ha1, fun x hx y hya => h x hx y (Or.inl hya)⟩, ⟨hb1, fun x hx y hyb => h x hx y (Or.inr hyb)⟩⟩ have hrew : (∑ S ∈ (univ : Finset (Fin n)).powersetCard 6, if a ≠ b ∧ a ∈ C S ∧ b ∈ C S then 1 else 0) = (((univ : Finset (Fin n)).powersetCard 6).filter fun S => a ∉ S ∧ b ∉ S ∧ ∀ x ∈ S, ∀ y, A x y = a ∨ A x y = b → y ∈ S).card := by have h1 : (fun S => (if a ≠ b ∧ a ∈ C S ∧ b ∈ C S then (1 : ℕ) else 0)) = fun S => if (a ∉ S ∧ b ∉ S ∧ ∀ x ∈ S, ∀ y, A x y = a ∨ A x y = b → y ∈ S) then 1 else 0 := by ext S rw [if_congr (hiff S) rfl rfl] rw [h1, ← sum_filter] simp rw [hrew] have hb := wild_normalized_array_common_six_seals_bound n A hdiag hsymm hinj a b hab have hpos : 0 < 6 := by decide rw [Nat.le_div_iff_mul_le hpos] linarith exact wild_normalized_array_six_seal_second_factorial_bound_sum_pairs n g hzero hbound