Theorem: SzemerediRegularity.card_nonuniformWitness_sdiff_biUnion_star
File: Mathlib/Combinatorics/SimpleGraph/Regularity/Chunk.lean

tactic: have hX : G.nonuniformWitness ε U V ∈ P.nonuniformWitnesses G ε U :=
  nonuniformWitness_mem_nonuniformWitnesses h₂ hV hUV
state_before: α : Type u_1
inst✝² : Fintype α
inst✝¹ : DecidableEq α
P : Finpartition univ
hP : P.IsEquipartition
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
U : Finset α
hU : U ∈ P.parts
V : Finset α
𝒜 : Finset (Finset α)
s : Finset α
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
state_after: α : Type u_1
inst✝² : Fintype α
inst✝¹ : DecidableEq α
P : Finpartition univ
hP : P.IsEquipartition
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
U : Finset α
hU : U ∈ P.parts
V : Finset α
𝒜 : Finset (Finset α)
s : Finset α
hV : V ∈ P.parts
hUV : U ≠ V
h₂ : ¬G.IsUniform ε U V
hX : G.nonuniformWitness ε U V ∈ P.nonuniformWitnesses G ε U
⊢ (G.nonuniformWitness ε U V \ (star hP G ε hU V).biUnion id).card ≤ 2 ^ (P.parts.card - 1) * m

tactic: apply (card_le_card q).trans (card_biUnion_le.trans _)
state_before: α : Type u_1
inst✝² : Fintype α
inst✝¹ : DecidableEq α
P : Finpartition univ
hP : P.IsEquipartition
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
U : Finset α
hU : U ∈ P.parts
V : Finset α
𝒜 : Finset (Finset α)
s : Finset α
hV : V ∈ P.parts
hUV : U ≠ V
h₂ : ¬G.IsUniform ε U V
hX : G.nonuniformWitness ε U V ∈ P.nonuniformWitnesses G ε U
q :
  G.nonuniformWitness ε U V \ (star hP G ε hU V).biUnion id ⊆
    (filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty)
          (atomise U (P.nonuniformWitnesses G ε U)).parts).biUnion
      fun B => B \ (filter (fun x => x ⊆ B) (chunk hP G ε hU).parts).biUnion id
⊢ (G.nonuniformWitness ε U V \ (star hP G ε hU V).biUnion id).card ≤ 2 ^ (P.parts.card - 1) * m
state_after: α : Type u_1
inst✝² : Fintype α
inst✝¹ : DecidableEq α
P : Finpartition univ
hP : P.IsEquipartition
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
U : Finset α
hU : U ∈ P.parts
V : Finset α
𝒜 : Finset (Finset α)
s : Finset α
hV : V ∈ P.parts
hUV : U ≠ V
h₂ : ¬G.IsUniform ε U V
hX : G.nonuniformWitness ε U V ∈ P.nonuniformWitnesses G ε U
q :
  G.nonuniformWitness ε U V \ (star hP G ε hU V).biUnion id ⊆
    (filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty)
          (atomise U (P.nonuniformWitnesses G ε U)).parts).biUnion
      fun B => B \ (filter (fun x => x ⊆ B) (chunk hP G ε hU).parts).biUnion id
⊢ ∑ a ∈ filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty) (atomise U (P.nonuniformWitnesses G ε U)).parts,
      (a \ (filter (fun x => x ⊆ a) (chunk hP G ε hU).parts).biUnion id).card ≤
    2 ^ (P.parts.card - 1) * m

tactic: trans ∑ _i in (atomise U <| P.nonuniformWitnesses G ε U).parts.filter fun B =>
  B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty, m
state_before: α : Type u_1
inst✝² : Fintype α
inst✝¹ : DecidableEq α
P : Finpartition univ
hP : P.IsEquipartition
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
U : Finset α
hU : U ∈ P.parts
V : Finset α
𝒜 : Finset (Finset α)
s : Finset α
hV : V ∈ P.parts
hUV : U ≠ V
h₂ : ¬G.IsUniform ε U V
hX : G.nonuniformWitness ε U V ∈ P.nonuniformWitnesses G ε U
q :
  G.nonuniformWitness ε U V \ (star hP G ε hU V).biUnion id ⊆
    (filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty)
          (atomise U (P.nonuniformWitnesses G ε U)).parts).biUnion
      fun B => B \ (filter (fun x => x ⊆ B) (chunk hP G ε hU).parts).biUnion id
⊢ ∑ a ∈ filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty) (atomise U (P.nonuniformWitnesses G ε U)).parts,
      (a \ (filter (fun x => x ⊆ a) (chunk hP G ε hU).parts).biUnion id).card ≤
    2 ^ (P.parts.card - 1) * m
state_after: α : Type u_1
inst✝² : Fintype α
inst✝¹ : DecidableEq α
P : Finpartition univ
hP : P.IsEquipartition
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
U : Finset α
hU : U ∈ P.parts
V : Finset α
𝒜 : Finset (Finset α)
s : Finset α
hV : V ∈ P.parts
hUV : U ≠ V
h₂ : ¬G.IsUniform ε U V
hX : G.nonuniformWitness ε U V ∈ P.nonuniformWitnesses G ε U
q :
  G.nonuniformWitness ε U V \ (star hP G ε hU V).biUnion id ⊆
    (filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty)
          (atomise U (P.nonuniformWitnesses G ε U)).parts).biUnion
      fun B => B \ (filter (fun x => x ⊆ B) (chunk hP G ε hU).parts).biUnion id
⊢ ∑ a ∈ filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty) (atomise U (P.nonuniformWitnesses G ε U)).parts,
      (a \ (filter (fun x => x ⊆ a) (chunk hP G ε hU).parts).biUnion id).card ≤
    ∑ _i ∈ filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty) (atomise U (P.nonuniformWitnesses G ε U)).parts,
      m

α : Type u_1
inst✝² : Fintype α
inst✝¹ : DecidableEq α
P : Finpartition univ
hP : P.IsEquipartition
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
U : Finset α
hU : U ∈ P.parts
V : Finset α
𝒜 : Finset (Finset α)
s : Finset α
hV : V ∈ P.parts
hUV : U ≠ V
h₂ : ¬G.IsUniform ε U V
hX : G.nonuniformWitness ε U V ∈ P.nonuniformWitnesses G ε U
q :
  G.nonuniformWitness ε U V \ (star hP G ε hU V).biUnion id ⊆
    (filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty)
          (atomise U (P.nonuniformWitnesses G ε U)).parts).biUnion
      fun B => B \ (filter (fun x => x ⊆ B) (chunk hP G ε hU).parts).biUnion id
⊢ ∑ _i ∈ filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty) (atomise U (P.nonuniformWitnesses G ε U)).parts,
      m ≤
    2 ^ (P.parts.card - 1) * m

tactic: rw [sum_const]
state_before: α : Type u_1
inst✝² : Fintype α
inst✝¹ : DecidableEq α
P : Finpartition univ
hP : P.IsEquipartition
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
U : Finset α
hU : U ∈ P.parts
V : Finset α
𝒜 : Finset (Finset α)
s : Finset α
hV : V ∈ P.parts
hUV : U ≠ V
h₂ : ¬G.IsUniform ε U V
hX : G.nonuniformWitness ε U V ∈ P.nonuniformWitnesses G ε U
q :
  G.nonuniformWitness ε U V \ (star hP G ε hU V).biUnion id ⊆
    (filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty)
          (atomise U (P.nonuniformWitnesses G ε U)).parts).biUnion
      fun B => B \ (filter (fun x => x ⊆ B) (chunk hP G ε hU).parts).biUnion id
⊢ ∑ _i ∈ filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty) (atomise U (P.nonuniformWitnesses G ε U)).parts,
      m ≤
    2 ^ (P.parts.card - 1) * m
state_after: α : Type u_1
inst✝² : Fintype α
inst✝¹ : DecidableEq α
P : Finpartition univ
hP : P.IsEquipartition
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
U : Finset α
hU : U ∈ P.parts
V : Finset α
𝒜 : Finset (Finset α)
s : Finset α
hV : V ∈ P.parts
hUV : U ≠ V
h₂ : ¬G.IsUniform ε U V
hX : G.nonuniformWitness ε U V ∈ P.nonuniformWitnesses G ε U
q :
  G.nonuniformWitness ε U V \ (star hP G ε hU V).biUnion id ⊆
    (filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty)
          (atomise U (P.nonuniformWitnesses G ε U)).parts).biUnion
      fun B => B \ (filter (fun x => x ⊆ B) (chunk hP G ε hU).parts).biUnion id
⊢ (filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty) (atomise U (P.nonuniformWitnesses G ε U)).parts).card •
      m ≤
    2 ^ (P.parts.card - 1) * m

tactic: refine mul_le_mul_right' ?_ _
state_before: α : Type u_1
inst✝² : Fintype α
inst✝¹ : DecidableEq α
P : Finpartition univ
hP : P.IsEquipartition
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
U : Finset α
hU : U ∈ P.parts
V : Finset α
𝒜 : Finset (Finset α)
s : Finset α
hV : V ∈ P.parts
hUV : U ≠ V
h₂ : ¬G.IsUniform ε U V
hX : G.nonuniformWitness ε U V ∈ P.nonuniformWitnesses G ε U
q :
  G.nonuniformWitness ε U V \ (star hP G ε hU V).biUnion id ⊆
    (filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty)
          (atomise U (P.nonuniformWitnesses G ε U)).parts).biUnion
      fun B => B \ (filter (fun x => x ⊆ B) (chunk hP G ε hU).parts).biUnion id
⊢ (filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty) (atomise U (P.nonuniformWitnesses G ε U)).parts).card •
      m ≤
    2 ^ (P.parts.card - 1) * m
state_after: α : Type u_1
inst✝² : Fintype α
inst✝¹ : DecidableEq α
P : Finpartition univ
hP : P.IsEquipartition
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
U : Finset α
hU : U ∈ P.parts
V : Finset α
𝒜 : Finset (Finset α)
s : Finset α
hV : V ∈ P.parts
hUV : U ≠ V
h₂ : ¬G.IsUniform ε U V
hX : G.nonuniformWitness ε U V ∈ P.nonuniformWitnesses G ε U
q :
  G.nonuniformWitness ε U V \ (star hP G ε hU V).biUnion id ⊆
    (filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty)
          (atomise U (P.nonuniformWitnesses G ε U)).parts).biUnion
      fun B => B \ (filter (fun x => x ⊆ B) (chunk hP G ε hU).parts).biUnion id
⊢ (filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty) (atomise U (P.nonuniformWitnesses G ε U)).parts).card ≤
    2 ^ (P.parts.card - 1)

tactic: have t := card_filter_atomise_le_two_pow (s := U) hX
state_before: α : Type u_1
inst✝² : Fintype α
inst✝¹ : DecidableEq α
P : Finpartition univ
hP : P.IsEquipartition
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
U : Finset α
hU : U ∈ P.parts
V : Finset α
𝒜 : Finset (Finset α)
s : Finset α
hV : V ∈ P.parts
hUV : U ≠ V
h₂ : ¬G.IsUniform ε U V
hX : G.nonuniformWitness ε U V ∈ P.nonuniformWitnesses G ε U
q :
  G.nonuniformWitness ε U V \ (star hP G ε hU V).biUnion id ⊆
    (filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty)
          (atomise U (P.nonuniformWitnesses G ε U)).parts).biUnion
      fun B => B \ (filter (fun x => x ⊆ B) (chunk hP G ε hU).parts).biUnion id
⊢ (filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty) (atomise U (P.nonuniformWitnesses G ε U)).parts).card ≤
    2 ^ (P.parts.card - 1)
state_after: α : Type u_1
inst✝² : Fintype α
inst✝¹ : DecidableEq α
P : Finpartition univ
hP : P.IsEquipartition
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
U : Finset α
hU : U ∈ P.parts
V : Finset α
𝒜 : Finset (Finset α)
s : Finset α
hV : V ∈ P.parts
hUV : U ≠ V
h₂ : ¬G.IsUniform ε U V
hX : G.nonuniformWitness ε U V ∈ P.nonuniformWitnesses G ε U
q :
  G.nonuniformWitness ε U V \ (star hP G ε hU V).biUnion id ⊆
    (filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty)
          (atomise U (P.nonuniformWitnesses G ε U)).parts).biUnion
      fun B => B \ (filter (fun x => x ⊆ B) (chunk hP G ε hU).parts).biUnion id
t :
  (filter (fun u => u ⊆ G.nonuniformWitness ε U V ∧ u.Nonempty) (atomise U (P.nonuniformWitnesses G ε U)).parts).card ≤
    2 ^ ((P.nonuniformWitnesses G ε U).card - 1)
⊢ (filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty) (atomise U (P.nonuniformWitnesses G ε U)).parts).card ≤
    2 ^ (P.parts.card - 1)

tactic: refine t.trans (pow_le_pow_right (by norm_num) <| tsub_le_tsub_right ?_ _)
state_before: α : Type u_1
inst✝² : Fintype α
inst✝¹ : DecidableEq α
P : Finpartition univ
hP : P.IsEquipartition
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
U : Finset α
hU : U ∈ P.parts
V : Finset α
𝒜 : Finset (Finset α)
s : Finset α
hV : V ∈ P.parts
hUV : U ≠ V
h₂ : ¬G.IsUniform ε U V
hX : G.nonuniformWitness ε U V ∈ P.nonuniformWitnesses G ε U
q :
  G.nonuniformWitness ε U V \ (star hP G ε hU V).biUnion id ⊆
    (filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty)
          (atomise U (P.nonuniformWitnesses G ε U)).parts).biUnion
      fun B => B \ (filter (fun x => x ⊆ B) (chunk hP G ε hU).parts).biUnion id
t :
  (filter (fun u => u ⊆ G.nonuniformWitness ε U V ∧ u.Nonempty) (atomise U (P.nonuniformWitnesses G ε U)).parts).card ≤
    2 ^ ((P.nonuniformWitnesses G ε U).card - 1)
⊢ (filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty) (atomise U (P.nonuniformWitnesses G ε U)).parts).card ≤
    2 ^ (P.parts.card - 1)
state_after: α : Type u_1
inst✝² : Fintype α
inst✝¹ : DecidableEq α
P : Finpartition univ
hP : P.IsEquipartition
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
U : Finset α
hU : U ∈ P.parts
V : Finset α
𝒜 : Finset (Finset α)
s : Finset α
hV : V ∈ P.parts
hUV : U ≠ V
h₂ : ¬G.IsUniform ε U V
hX : G.nonuniformWitness ε U V ∈ P.nonuniformWitnesses G ε U
q :
  G.nonuniformWitness ε U V \ (star hP G ε hU V).biUnion id ⊆
    (filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty)
          (atomise U (P.nonuniformWitnesses G ε U)).parts).biUnion
      fun B => B \ (filter (fun x => x ⊆ B) (chunk hP G ε hU).parts).biUnion id
t :
  (filter (fun u => u ⊆ G.nonuniformWitness ε U V ∧ u.Nonempty) (atomise U (P.nonuniformWitnesses G ε U)).parts).card ≤
    2 ^ ((P.nonuniformWitnesses G ε U).card - 1)
⊢ (P.nonuniformWitnesses G ε U).card ≤ P.parts.card

tactic: exact card_image_le.trans (card_le_card <| filter_subset _ _)
state_before: α : Type u_1
inst✝² : Fintype α
inst✝¹ : DecidableEq α
P : Finpartition univ
hP : P.IsEquipartition
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
U : Finset α
hU : U ∈ P.parts
V : Finset α
𝒜 : Finset (Finset α)
s : Finset α
hV : V ∈ P.parts
hUV : U ≠ V
h₂ : ¬G.IsUniform ε U V
hX : G.nonuniformWitness ε U V ∈ P.nonuniformWitnesses G ε U
q :
  G.nonuniformWitness ε U V \ (star hP G ε hU V).biUnion id ⊆
    (filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty)
          (atomise U (P.nonuniformWitnesses G ε U)).parts).biUnion
      fun B => B \ (filter (fun x => x ⊆ B) (chunk hP G ε hU).parts).biUnion id
t :
  (filter (fun u => u ⊆ G.nonuniformWitness ε U V ∧ u.Nonempty) (atomise U (P.nonuniformWitnesses G ε U)).parts).card ≤
    2 ^ ((P.nonuniformWitnesses G ε U).card - 1)
⊢ (P.nonuniformWitnesses G ε U).card ≤ P.parts.card
state_after: no goals

tactic: intro x hx
state_before: α : Type u_1
inst✝² : Fintype α
inst✝¹ : DecidableEq α
P : Finpartition univ
hP : P.IsEquipartition
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
U : Finset α
hU : U ∈ P.parts
V : Finset α
𝒜 : Finset (Finset α)
s : Finset α
hV : V ∈ P.parts
hUV : U ≠ V
h₂ : ¬G.IsUniform ε U V
hX : G.nonuniformWitness ε U V ∈ P.nonuniformWitnesses G ε U
⊢ G.nonuniformWitness ε U V \ (star hP G ε hU V).biUnion id ⊆
    (filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty)
          (atomise U (P.nonuniformWitnesses G ε U)).parts).biUnion
      fun B => B \ (filter (fun x => x ⊆ B) (chunk hP G ε hU).parts).biUnion id
state_after: α : Type u_1
inst✝² : Fintype α
inst✝¹ : DecidableEq α
P : Finpartition univ
hP : P.IsEquipartition
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
U : Finset α
hU : U ∈ P.parts
V : Finset α
𝒜 : Finset (Finset α)
s : Finset α
hV : V ∈ P.parts
hUV : U ≠ V
h₂ : ¬G.IsUniform ε U V
hX : G.nonuniformWitness ε U V ∈ P.nonuniformWitnesses G ε U
x : α
hx : x ∈ G.nonuniformWitness ε U V \ (star hP G ε hU V).biUnion id
⊢ x ∈
    (filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty)
          (atomise U (P.nonuniformWitnesses G ε U)).parts).biUnion
      fun B => B \ (filter (fun x => x ⊆ B) (chunk hP G ε hU).parts).biUnion id

tactic: rw [← biUnion_filter_atomise hX (G.nonuniformWitness_subset h₂), star, mem_sdiff,
  mem_biUnion] at hx
state_before: α : Type u_1
inst✝² : Fintype α
inst✝¹ : DecidableEq α
P : Finpartition univ
hP : P.IsEquipartition
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
U : Finset α
hU : U ∈ P.parts
V : Finset α
𝒜 : Finset (Finset α)
s : Finset α
hV : V ∈ P.parts
hUV : U ≠ V
h₂ : ¬G.IsUniform ε U V
hX : G.nonuniformWitness ε U V ∈ P.nonuniformWitnesses G ε U
x : α
hx : x ∈ G.nonuniformWitness ε U V \ (star hP G ε hU V).biUnion id
⊢ x ∈
    (filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty)
          (atomise U (P.nonuniformWitnesses G ε U)).parts).biUnion
      fun B => B \ (filter (fun x => x ⊆ B) (chunk hP G ε hU).parts).biUnion id
state_after: α : Type u_1
inst✝² : Fintype α
inst✝¹ : DecidableEq α
P : Finpartition univ
hP : P.IsEquipartition
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
U : Finset α
hU : U ∈ P.parts
V : Finset α
𝒜 : Finset (Finset α)
s : Finset α
hV : V ∈ P.parts
hUV : U ≠ V
h₂ : ¬G.IsUniform ε U V
hX : G.nonuniformWitness ε U V ∈ P.nonuniformWitnesses G ε U
x : α
hx :
  (∃ a ∈ filter (fun u => u ⊆ G.nonuniformWitness ε U V ∧ u.Nonempty) (atomise U (P.nonuniformWitnesses G ε U)).parts,
      x ∈ id a) ∧
    x ∉ (filter (fun x => x ⊆ G.nonuniformWitness ε U V) (chunk hP G ε hU).parts).biUnion id
⊢ x ∈
    (filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty)
          (atomise U (P.nonuniformWitnesses G ε U)).parts).biUnion
      fun B => B \ (filter (fun x => x ⊆ B) (chunk hP G ε hU).parts).biUnion id

tactic: simp only [not_exists, mem_biUnion, and_imp, exists_prop, mem_filter,
  not_and, mem_sdiff, id, mem_sdiff] at hx ⊢
state_before: α : Type u_1
inst✝² : Fintype α
inst✝¹ : DecidableEq α
P : Finpartition univ
hP : P.IsEquipartition
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
U : Finset α
hU : U ∈ P.parts
V : Finset α
𝒜 : Finset (Finset α)
s : Finset α
hV : V ∈ P.parts
hUV : U ≠ V
h₂ : ¬G.IsUniform ε U V
hX : G.nonuniformWitness ε U V ∈ P.nonuniformWitnesses G ε U
x : α
hx :
  (∃ a ∈ filter (fun u => u ⊆ G.nonuniformWitness ε U V ∧ u.Nonempty) (atomise U (P.nonuniformWitnesses G ε U)).parts,
      x ∈ id a) ∧
    x ∉ (filter (fun x => x ⊆ G.nonuniformWitness ε U V) (chunk hP G ε hU).parts).biUnion id
⊢ x ∈
    (filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty)
          (atomise U (P.nonuniformWitnesses G ε U)).parts).biUnion
      fun B => B \ (filter (fun x => x ⊆ B) (chunk hP G ε hU).parts).biUnion id
state_after: α : Type u_1
inst✝² : Fintype α
inst✝¹ : DecidableEq α
P : Finpartition univ
hP : P.IsEquipartition
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
U : Finset α
hU : U ∈ P.parts
V : Finset α
𝒜 : Finset (Finset α)
s : Finset α
hV : V ∈ P.parts
hUV : U ≠ V
h₂ : ¬G.IsUniform ε U V
hX : G.nonuniformWitness ε U V ∈ P.nonuniformWitnesses G ε U
x : α
hx :
  (∃ a, (a ∈ (atomise U (P.nonuniformWitnesses G ε U)).parts ∧ a ⊆ G.nonuniformWitness ε U V ∧ a.Nonempty) ∧ x ∈ a) ∧
    ∀ x_1 ∈ (chunk hP G ε hU).parts, x_1 ⊆ G.nonuniformWitness ε U V → x ∉ x_1
⊢ ∃ a,
    (a ∈ (atomise U (P.nonuniformWitnesses G ε U)).parts ∧ a ⊆ G.nonuniformWitness ε U V ∧ a.Nonempty) ∧
      x ∈ a ∧ ∀ x_1 ∈ (chunk hP G ε hU).parts, x_1 ⊆ a → x ∉ x_1

tactic: obtain ⟨⟨B, hB₁, hB₂⟩, hx⟩ := hx
state_before: α : Type u_1
inst✝² : Fintype α
inst✝¹ : DecidableEq α
P : Finpartition univ
hP : P.IsEquipartition
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
U : Finset α
hU : U ∈ P.parts
V : Finset α
𝒜 : Finset (Finset α)
s : Finset α
hV : V ∈ P.parts
hUV : U ≠ V
h₂ : ¬G.IsUniform ε U V
hX : G.nonuniformWitness ε U V ∈ P.nonuniformWitnesses G ε U
x : α
hx :
  (∃ a, (a ∈ (atomise U (P.nonuniformWitnesses G ε U)).parts ∧ a ⊆ G.nonuniformWitness ε U V ∧ a.Nonempty) ∧ x ∈ a) ∧
    ∀ x_1 ∈ (chunk hP G ε hU).parts, x_1 ⊆ G.nonuniformWitness ε U V → x ∉ x_1
⊢ ∃ a,
    (a ∈ (atomise U (P.nonuniformWitnesses G ε U)).parts ∧ a ⊆ G.nonuniformWitness ε U V ∧ a.Nonempty) ∧
      x ∈ a ∧ ∀ x_1 ∈ (chunk hP G ε hU).parts, x_1 ⊆ a → x ∉ x_1
state_after: case intro.intro.intro
α : Type u_1
inst✝² : Fintype α
inst✝¹ : DecidableEq α
P : Finpartition univ
hP : P.IsEquipartition
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
U : Finset α
hU : U ∈ P.parts
V : Finset α
𝒜 : Finset (Finset α)
s : Finset α
hV : V ∈ P.parts
hUV : U ≠ V
h₂ : ¬G.IsUniform ε U V
hX : G.nonuniformWitness ε U V ∈ P.nonuniformWitnesses G ε U
x : α
hx : ∀ x_1 ∈ (chunk hP G ε hU).parts, x_1 ⊆ G.nonuniformWitness ε U V → x ∉ x_1
B : Finset α
hB₁ : B ∈ (atomise U (P.nonuniformWitnesses G ε U)).parts ∧ B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty
hB₂ : x ∈ B
⊢ ∃ a,
    (a ∈ (atomise U (P.nonuniformWitnesses G ε U)).parts ∧ a ⊆ G.nonuniformWitness ε U V ∧ a.Nonempty) ∧
      x ∈ a ∧ ∀ x_1 ∈ (chunk hP G ε hU).parts, x_1 ⊆ a → x ∉ x_1

tactic: exact ⟨B, hB₁, hB₂, fun A hA AB => hx A hA <| AB.trans hB₁.2.1⟩
state_before: case intro.intro.intro
α : Type u_1
inst✝² : Fintype α
inst✝¹ : DecidableEq α
P : Finpartition univ
hP : P.IsEquipartition
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
U : Finset α
hU : U ∈ P.parts
V : Finset α
𝒜 : Finset (Finset α)
s : Finset α
hV : V ∈ P.parts
hUV : U ≠ V
h₂ : ¬G.IsUniform ε U V
hX : G.nonuniformWitness ε U V ∈ P.nonuniformWitnesses G ε U
x : α
hx : ∀ x_1 ∈ (chunk hP G ε hU).parts, x_1 ⊆ G.nonuniformWitness ε U V → x ∉ x_1
B : Finset α
hB₁ : B ∈ (atomise U (P.nonuniformWitnesses G ε U)).parts ∧ B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty
hB₂ : x ∈ B
⊢ ∃ a,
    (a ∈ (atomise U (P.nonuniformWitnesses G ε U)).parts ∧ a ⊆ G.nonuniformWitness ε U V ∧ a.Nonempty) ∧
      x ∈ a ∧ ∀ x_1 ∈ (chunk hP G ε hU).parts, x_1 ⊆ a → x ∉ x_1
state_after: no goals

tactic: intro B hB
state_before: α : Type u_1
inst✝² : Fintype α
inst✝¹ : DecidableEq α
P : Finpartition univ
hP : P.IsEquipartition
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
U : Finset α
hU : U ∈ P.parts
V : Finset α
𝒜 : Finset (Finset α)
s : Finset α
hV : V ∈ P.parts
hUV : U ≠ V
h₂ : ¬G.IsUniform ε U V
hX : G.nonuniformWitness ε U V ∈ P.nonuniformWitnesses G ε U
q :
  G.nonuniformWitness ε U V \ (star hP G ε hU V).biUnion id ⊆
    (filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty)
          (atomise U (P.nonuniformWitnesses G ε U)).parts).biUnion
      fun B => B \ (filter (fun x => x ⊆ B) (chunk hP G ε hU).parts).biUnion id
⊢ ∀ B ∈ (atomise U (P.nonuniformWitnesses G ε U)).parts,
    (B \ (filter (fun x => x ⊆ B) (chunk hP G ε hU).parts).biUnion id).card ≤ m
state_after: α : Type u_1
inst✝² : Fintype α
inst✝¹ : DecidableEq α
P : Finpartition univ
hP : P.IsEquipartition
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
U : Finset α
hU : U ∈ P.parts
V : Finset α
𝒜 : Finset (Finset α)
s : Finset α
hV : V ∈ P.parts
hUV : U ≠ V
h₂ : ¬G.IsUniform ε U V
hX : G.nonuniformWitness ε U V ∈ P.nonuniformWitnesses G ε U
q :
  G.nonuniformWitness ε U V \ (star hP G ε hU V).biUnion id ⊆
    (filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty)
          (atomise U (P.nonuniformWitnesses G ε U)).parts).biUnion
      fun B => B \ (filter (fun x => x ⊆ B) (chunk hP G ε hU).parts).biUnion id
B : Finset α
hB : B ∈ (atomise U (P.nonuniformWitnesses G ε U)).parts
⊢ (B \ (filter (fun x => x ⊆ B) (chunk hP G ε hU).parts).biUnion id).card ≤ m

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

tactic: split_ifs with h₁
state_before: α : Type u_1
inst✝² : Fintype α
inst✝¹ : DecidableEq α
P : Finpartition univ
hP : P.IsEquipartition
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
U : Finset α
hU : U ∈ P.parts
V : Finset α
𝒜 : Finset (Finset α)
s : Finset α
hV : V ∈ P.parts
hUV : U ≠ V
h₂ : ¬G.IsUniform ε U V
hX : G.nonuniformWitness ε U V ∈ P.nonuniformWitnesses G ε U
q :
  G.nonuniformWitness ε U V \ (star hP G ε hU V).biUnion id ⊆
    (filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty)
          (atomise U (P.nonuniformWitnesses G ε U)).parts).biUnion
      fun B => B \ (filter (fun x => x ⊆ B) (chunk hP G ε hU).parts).biUnion id
B : Finset α
hB : B ∈ (atomise U (P.nonuniformWitnesses G ε U)).parts
⊢ (B \
        (filter (fun x => x ⊆ B)
              (if hUcard : U.card = m * 4 ^ P.parts.card + (Fintype.card α / P.parts.card - m * 4 ^ P.parts.card) then
                  equitabilise ⋯
                else equitabilise ⋯).parts).biUnion
          id).card ≤
    m
state_after: case pos
α : Type u_1
inst✝² : Fintype α
inst✝¹ : DecidableEq α
P : Finpartition univ
hP : P.IsEquipartition
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
U : Finset α
hU : U ∈ P.parts
V : Finset α
𝒜 : Finset (Finset α)
s : Finset α
hV : V ∈ P.parts
hUV : U ≠ V
h₂ : ¬G.IsUniform ε U V
hX : G.nonuniformWitness ε U V ∈ P.nonuniformWitnesses G ε U
q :
  G.nonuniformWitness ε U V \ (star hP G ε hU V).biUnion id ⊆
    (filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty)
          (atomise U (P.nonuniformWitnesses G ε U)).parts).biUnion
      fun B => B \ (filter (fun x => x ⊆ B) (chunk hP G ε hU).parts).biUnion id
B : Finset α
hB : B ∈ (atomise U (P.nonuniformWitnesses G ε U)).parts
h₁ : U.card = m * 4 ^ P.parts.card + (Fintype.card α / P.parts.card - m * 4 ^ P.parts.card)
⊢ (B \ (filter (fun x => x ⊆ B) (equitabilise ⋯).parts).biUnion id).card ≤ m

case neg
α : Type u_1
inst✝² : Fintype α
inst✝¹ : DecidableEq α
P : Finpartition univ
hP : P.IsEquipartition
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
U : Finset α
hU : U ∈ P.parts
V : Finset α
𝒜 : Finset (Finset α)
s : Finset α
hV : V ∈ P.parts
hUV : U ≠ V
h₂ : ¬G.IsUniform ε U V
hX : G.nonuniformWitness ε U V ∈ P.nonuniformWitnesses G ε U
q :
  G.nonuniformWitness ε U V \ (star hP G ε hU V).biUnion id ⊆
    (filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty)
          (atomise U (P.nonuniformWitnesses G ε U)).parts).biUnion
      fun B => B \ (filter (fun x => x ⊆ B) (chunk hP G ε hU).parts).biUnion id
B : Finset α
hB : B ∈ (atomise U (P.nonuniformWitnesses G ε U)).parts
h₁ : ¬U.card = m * 4 ^ P.parts.card + (Fintype.card α / P.parts.card - m * 4 ^ P.parts.card)
⊢ (B \ (filter (fun x => x ⊆ B) (equitabilise ⋯).parts).biUnion id).card ≤ m

tactic: exact sum_le_sum fun B hB => this B <| filter_subset _ _ hB
state_before: α : Type u_1
inst✝² : Fintype α
inst✝¹ : DecidableEq α
P : Finpartition univ
hP : P.IsEquipartition
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
U : Finset α
hU : U ∈ P.parts
V : Finset α
𝒜 : Finset (Finset α)
s : Finset α
hV : V ∈ P.parts
hUV : U ≠ V
h₂ : ¬G.IsUniform ε U V
hX : G.nonuniformWitness ε U V ∈ P.nonuniformWitnesses G ε U
q :
  G.nonuniformWitness ε U V \ (star hP G ε hU V).biUnion id ⊆
    (filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty)
          (atomise U (P.nonuniformWitnesses G ε U)).parts).biUnion
      fun B => B \ (filter (fun x => x ⊆ B) (chunk hP G ε hU).parts).biUnion id
this :
  ∀ B ∈ (atomise U (P.nonuniformWitnesses G ε U)).parts,
    (B \ (filter (fun x => x ⊆ B) (chunk hP G ε hU).parts).biUnion id).card ≤ m
⊢ ∑ a ∈ filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty) (atomise U (P.nonuniformWitnesses G ε U)).parts,
      (a \ (filter (fun x => x ⊆ a) (chunk hP G ε hU).parts).biUnion id).card ≤
    ∑ _i ∈ filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty) (atomise U (P.nonuniformWitnesses G ε U)).parts,
      m
state_after: no goals

tactic: convert card_parts_equitabilise_subset_le _ (card_aux₁ h₁) hB
state_before: case pos
α : Type u_1
inst✝² : Fintype α
inst✝¹ : DecidableEq α
P : Finpartition univ
hP : P.IsEquipartition
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
U : Finset α
hU : U ∈ P.parts
V : Finset α
𝒜 : Finset (Finset α)
s : Finset α
hV : V ∈ P.parts
hUV : U ≠ V
h₂ : ¬G.IsUniform ε U V
hX : G.nonuniformWitness ε U V ∈ P.nonuniformWitnesses G ε U
q :
  G.nonuniformWitness ε U V \ (star hP G ε hU V).biUnion id ⊆
    (filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty)
          (atomise U (P.nonuniformWitnesses G ε U)).parts).biUnion
      fun B => B \ (filter (fun x => x ⊆ B) (chunk hP G ε hU).parts).biUnion id
B : Finset α
hB : B ∈ (atomise U (P.nonuniformWitnesses G ε U)).parts
h₁ : U.card = m * 4 ^ P.parts.card + (Fintype.card α / P.parts.card - m * 4 ^ P.parts.card)
⊢ (B \ (filter (fun x => x ⊆ B) (equitabilise ⋯).parts).biUnion id).card ≤ m
state_after: no goals

tactic: convert card_parts_equitabilise_subset_le _ (card_aux₂ hP hU h₁) hB
state_before: case neg
α : Type u_1
inst✝² : Fintype α
inst✝¹ : DecidableEq α
P : Finpartition univ
hP : P.IsEquipartition
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
U : Finset α
hU : U ∈ P.parts
V : Finset α
𝒜 : Finset (Finset α)
s : Finset α
hV : V ∈ P.parts
hUV : U ≠ V
h₂ : ¬G.IsUniform ε U V
hX : G.nonuniformWitness ε U V ∈ P.nonuniformWitnesses G ε U
q :
  G.nonuniformWitness ε U V \ (star hP G ε hU V).biUnion id ⊆
    (filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty)
          (atomise U (P.nonuniformWitnesses G ε U)).parts).biUnion
      fun B => B \ (filter (fun x => x ⊆ B) (chunk hP G ε hU).parts).biUnion id
B : Finset α
hB : B ∈ (atomise U (P.nonuniformWitnesses G ε U)).parts
h₁ : ¬U.card = m * 4 ^ P.parts.card + (Fintype.card α / P.parts.card - m * 4 ^ P.parts.card)
⊢ (B \ (filter (fun x => x ⊆ B) (equitabilise ⋯).parts).biUnion id).card ≤ m
state_after: no goals

tactic: norm_num
state_before: α : Type u_1
inst✝² : Fintype α
inst✝¹ : DecidableEq α
P : Finpartition univ
hP : P.IsEquipartition
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
U : Finset α
hU : U ∈ P.parts
V : Finset α
𝒜 : Finset (Finset α)
s : Finset α
hV : V ∈ P.parts
hUV : U ≠ V
h₂ : ¬G.IsUniform ε U V
hX : G.nonuniformWitness ε U V ∈ P.nonuniformWitnesses G ε U
q :
  G.nonuniformWitness ε U V \ (star hP G ε hU V).biUnion id ⊆
    (filter (fun B => B ⊆ G.nonuniformWitness ε U V ∧ B.Nonempty)
          (atomise U (P.nonuniformWitnesses G ε U)).parts).biUnion
      fun B => B \ (filter (fun x => x ⊆ B) (chunk hP G ε hU).parts).biUnion id
t :
  (filter (fun u => u ⊆ G.nonuniformWitness ε U V ∧ u.Nonempty) (atomise U (P.nonuniformWitnesses G ε U)).parts).card ≤
    2 ^ ((P.nonuniformWitnesses G ε U).card - 1)
⊢ 1 ≤ 2
state_after: no goals