AFTD Auto-Formalizing Theoretical Domains

wild_normalized_array_six_seal_second_factorial_bound

theoremverified

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

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).

  1. 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.

    lines 8–14

    uses sum_congr, card_erase_of_mem, sum_const

      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]
  2. 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.

    lines 15–30

    uses mem_erase, ne_comm, if_congr, sum_filter, filter_mem_eq_of_subset, subset_univ, sum_const_zero

      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]
  3. 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.

    lines 31–33

    uses sum_filter, filter_mem_eq_of_subset, subset_univ

      simp_rw [hinner]
      rw [h1]
      rw [← sum_filter, filter_mem_eq_of_subset (subset_univ _)]
  4. 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).

    lines 41–52

    uses sum_erase_add, mem_univ, add_zero, sum_le_sum, mem_erase, card_erase_of_mem

      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]
  5. 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).

    lines 53–57

    uses sum_le_sum, mul_assoc

      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]
  6. 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.

    lines 68–79

    uses sum_congr, wild_normalized_array_six_seal_second_factorial_bound_card_mul_sub_one

      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]
  7. 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.

    lines 80–90

    uses sum_comm, sum_congr

      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]
  8. 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.

    lines 91–100

    uses sum_const_zero

      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]
  9. 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.

    lines 101–117

    uses mem_filter, mem_univ, true_and, Or.inl, Or.inr

      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)⟩⟩
  10. 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.

    lines 118–128

    uses if_congr, sum_filter

        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]
  11. 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.

    lines 129–132

    uses wild_normalized_array_common_six_seals_bound, Nat.le_div_iff_mul_le

        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
  12. 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.

    line 133

    uses wild_normalized_array_six_seal_second_factorial_bound_sum_pairs

      exact 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).

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

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
See it in the graphDiscuss this resultChallenge it