private theorem card_nonuniformWitness_sdiff_biUnion_star (hV : V ∈ P.parts) (hUV : U ≠ V)
    (h₂ : ¬G.IsUniform ε U V) :
    (G.nonuniformWitness ε U V \ (star hP G ε hU V).biUnion id).card ≤
    2 ^ (P.parts.card - 1) * m := by
  have hX : G.nonuniformWitness ε U V ∈ P.nonuniformWitnesses G ε U :=
    nonuniformWitness_mem_nonuniformWitnesses h₂ hV hUV
  have q : G.nonuniformWitness ε U V \ (star hP G ε hU V).biUnion id ⊆
      ((atomise U <| P.nonuniformWitnesses G ε U).parts.filter fun B =>
        B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty).biUnion
        fun B => B \ ((chunk hP G ε hU).parts.filter (· ⊆ B)).biUnion id := by
    intro x hx
    rw [← biUnion_filter_atomise hX (G.nonuniformWitness_subset h₂), star, mem_sdiff,
      mem_biUnion] at hx
    simp only [not_exists, mem_biUnion, and_imp, exists_prop, mem_filter,
      not_and, mem_sdiff, id.def, mem_sdiff] at hx ⊢
    obtain ⟨⟨B, hB₁, hB₂⟩, hx⟩ := hx
    exact ⟨B, hB₁, hB₂, fun A hA AB => hx A hA <| AB.trans hB₁.2.1⟩
  apply (card_le_of_subset q).trans (card_biUnion_le.trans _)
  trans ∑ _i in (atomise U <| P.nonuniformWitnesses G ε U).parts.filter fun B =>
    B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty, m
  · suffices ∀ B ∈ (atomise U <| P.nonuniformWitnesses G ε U).parts,
        (B \ ((chunk hP G ε hU).parts.filter (· ⊆ B)).biUnion id).card ≤ m by
      exact sum_le_sum fun B hB => this B <| filter_subset _ _ hB
    intro B hB
    unfold chunk
    

Proof state:
α : Type u_1
inst✝ : Fintype α
P : Finpartition univ
hP : IsEquipartition P
G : SimpleGraph α
ε : ℝ
U : Finset α
hU : U ∈ P.parts
V : Finset α
𝒜 : Finset (Finset α)
s : Finset α
hV : V ∈ P.parts
hUV : U ≠ V
h₂ : ¬SimpleGraph.IsUniform G ε U V
hX : SimpleGraph.nonuniformWitness G ε U V ∈ nonuniformWitnesses P G ε U
q :
  SimpleGraph.nonuniformWitness G ε U V \ Finset.biUnion (star hP G ε hU V) id ⊆
    Finset.biUnion
      (filter (fun B => B ⊆ SimpleGraph.nonuniformWitness G ε U V ∧ Finset.Nonempty B)
        (atomise U (nonuniformWitnesses P G ε U)).parts)
      fun B => B \ Finset.biUnion (filter (fun x => x ⊆ B) (chunk hP G ε hU).parts) id
B : Finset α
hB : B ∈ (atomise U (nonuniformWitnesses P G ε U)).parts
⊢ Finset.card
      (B \
        Finset.biUnion
          (filter (fun x => x ⊆ B)
            (if hUcard :
                  Finset.card U =
                    m * 4 ^ Finset.card P.parts +
                      (Fintype.card α / Finset.card P.parts - m * 4 ^ Finset.card P.parts) then
                equitabilise
                  (_ :
                    (4 ^ Finset.card P.parts - (Fintype.card α / Finset.card P.parts - m * 4 ^ Finset.card P.parts)) *
                          m +
                        (Fintype.card α / Finset.card P.parts - m * 4 ^ Finset.card P.parts) * (m + 1) =
                      Finset.card U)
              else
                equitabilise
                  (_ :
                    (4 ^ Finset.card P.parts -
                            (Fintype.card α / Finset.card P.parts - m * 4 ^ Finset.card P.parts + 1)) *
                          m +
                        (Fintype.card α / Finset.card P.parts - m * 4 ^ Finset.card P.parts + 1) * (m + 1) =
                      Finset.card U)).parts)
          id) ≤
    m

Next tactic:
split_ifs with h₁