l3lab/ntp-mathlib huggingface dataset:
theorem vectorAllP_iff_forall (p : α → Prop) (v : Vector3 α n) :
    VectorAllP p v ↔ ∀ i, p (v i) := by
  refine' v.recOn _ _
  · exact ⟨fun _ => Fin2.elim0, fun _ => trivial⟩
  · simp only [vectorAllP_cons]
    refine' fun {n} a v IH =>
      (and_congr_right fun _ => IH).trans
        ⟨fun ⟨pa, h⟩ i => by
          refine' i.cases' _ _
          

Proof state:
case refine'_1
α : Type u_1
m n✝ : ℕ
p : α → Prop
v✝ : Vector3 α n✝
n : ℕ
a : α
v : Vector3 α n
IH : VectorAllP p v ↔ ∀ (i : Fin2 n), p (v i)
x✝ : p a ∧ ∀ (i : Fin2 n), p (v i)
i : Fin2 (succ n)
pa : p a
h : ∀ (i : Fin2 n), p (v i)
⊢ p ((a :: v) fz)
case refine'_2
α : Type u_1
m n✝ : ℕ
p : α → Prop
v✝ : Vector3 α n✝
n : ℕ
a : α
v : Vector3 α n
IH : VectorAllP p v ↔ ∀ (i : Fin2 n), p (v i)
x✝ : p a ∧ ∀ (i : Fin2 n), p (v i)
i : Fin2 (succ n)
pa : p a
h : ∀ (i : Fin2 n), p (v i)
⊢ ∀ (n_1 : Fin2 n), p ((a :: v) (fs n_1))

Next tactic:
exacts [pa, h]
theorem vectorAllP_iff_forall (p : α → Prop) (v : Vector3 α n) :
    VectorAllP p v ↔ ∀ i, p (v i) := by
  refine' v.recOn _ _
  · exact ⟨fun _ => Fin2.elim0, fun _ => trivial⟩
  · simp only [vectorAllP_cons]
    refine' fun {n} a v IH =>
      (and_congr_right fun _ => IH).trans
        ⟨fun ⟨pa, h⟩ i => by
          refine' i.cases' _ _
          exacts [pa, h], fun h => ⟨_, fun i => _⟩⟩
    · 

Proof state:
case refine'_2.refine'_1
α : Type u_1
m n✝ : ℕ
p : α → Prop
v✝ : Vector3 α n✝
n : ℕ
a : α
v : Vector3 α n
IH : VectorAllP p v ↔ ∀ (i : Fin2 n), p (v i)
h : ∀ (i : Fin2 (succ n)), p ((a :: v) i)
⊢ p a

Next tactic:
simpa using h fz
theorem vectorAllP_iff_forall (p : α → Prop) (v : Vector3 α n) :
    VectorAllP p v ↔ ∀ i, p (v i) := by
  refine' v.recOn _ _
  · exact ⟨fun _ => Fin2.elim0, fun _ => trivial⟩
  · simp only [vectorAllP_cons]
    refine' fun {n} a v IH =>
      (and_congr_right fun _ => IH).trans
        ⟨fun ⟨pa, h⟩ i => by
          refine' i.cases' _ _
          exacts [pa, h], fun h => ⟨_, fun i => _⟩⟩
    · simpa using h fz
    · 

Proof state:
case refine'_2.refine'_2
α : Type u_1
m n✝ : ℕ
p : α → Prop
v✝ : Vector3 α n✝
n : ℕ
a : α
v : Vector3 α n
IH : VectorAllP p v ↔ ∀ (i : Fin2 n), p (v i)
h : ∀ (i : Fin2 (succ n)), p ((a :: v) i)
i : Fin2 n
⊢ p (v i)

Next tactic:
simpa using h (fs i)
/-- The increment partition has a prescribed (very big) size in terms of the original partition. -/
theorem card_increment (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α) (hPG : ¬P.IsUniform G ε) :
    (increment hP G ε).parts.card = stepBound P.parts.card := by
  

Proof state:
α : Type u_1
inst✝ : Fintype α
P : Finpartition univ
hP : IsEquipartition P
G : SimpleGraph α
ε : ℝ
hPα : Finset.card P.parts * 16 ^ Finset.card P.parts ≤ Fintype.card α
hPG : ¬Finpartition.IsUniform P G ε
⊢ Finset.card (increment hP G ε).parts = stepBound (Finset.card P.parts)

Next tactic:
have hPα' : stepBound P.parts.card ≤ card α :=
    (mul_le_mul_left' (pow_le_pow_left' (by norm_num) _) _).trans hPα
/-- The increment partition has a prescribed (very big) size in terms of the original partition. -/
theorem card_increment (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α) (hPG : ¬P.IsUniform G ε) :
    (increment hP G ε).parts.card = stepBound P.parts.card := by
  have hPα' : stepBound P.parts.card ≤ card α :=
    (mul_le_mul_left' (pow_le_pow_left' (by 

Proof state:
α : Type u_1
inst✝ : Fintype α
P : Finpartition univ
hP : IsEquipartition P
G : SimpleGraph α
ε : ℝ
hPα : Finset.card P.parts * 16 ^ Finset.card P.parts ≤ Fintype.card α
hPG : ¬Finpartition.IsUniform P G ε
⊢ 4 ≤ 16

Next tactic:
norm_num
/-- The increment partition has a prescribed (very big) size in terms of the original partition. -/
theorem card_increment (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α) (hPG : ¬P.IsUniform G ε) :
    (increment hP G ε).parts.card = stepBound P.parts.card := by
  have hPα' : stepBound P.parts.card ≤ card α :=
    (mul_le_mul_left' (pow_le_pow_left' (by norm_num) _) _).trans hPα
  

Proof state:
α : Type u_1
inst✝ : Fintype α
P : Finpartition univ
hP : IsEquipartition P
G : SimpleGraph α
ε : ℝ
hPα : Finset.card P.parts * 16 ^ Finset.card P.parts ≤ Fintype.card α
hPG : ¬Finpartition.IsUniform P G ε
hPα' : stepBound (Finset.card P.parts) ≤ Fintype.card α
⊢ Finset.card (increment hP G ε).parts = stepBound (Finset.card P.parts)

Next tactic:
have hPpos : 0 < stepBound P.parts.card := stepBound_pos (nonempty_of_not_uniform hPG).card_pos
/-- The increment partition has a prescribed (very big) size in terms of the original partition. -/
theorem card_increment (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α) (hPG : ¬P.IsUniform G ε) :
    (increment hP G ε).parts.card = stepBound P.parts.card := by
  have hPα' : stepBound P.parts.card ≤ card α :=
    (mul_le_mul_left' (pow_le_pow_left' (by norm_num) _) _).trans hPα
  have hPpos : 0 < stepBound P.parts.card := stepBound_pos (nonempty_of_not_uniform hPG).card_pos
  

Proof state:
α : Type u_1
inst✝ : Fintype α
P : Finpartition univ
hP : IsEquipartition P
G : SimpleGraph α
ε : ℝ
hPα : Finset.card P.parts * 16 ^ Finset.card P.parts ≤ Fintype.card α
hPG : ¬Finpartition.IsUniform P G ε
hPα' : stepBound (Finset.card P.parts) ≤ Fintype.card α
hPpos : 0 < stepBound (Finset.card P.parts)
⊢ Finset.card (increment hP G ε).parts = stepBound (Finset.card P.parts)

Next tactic:
rw [increment, card_bind]
/-- The increment partition has a prescribed (very big) size in terms of the original partition. -/
theorem card_increment (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α) (hPG : ¬P.IsUniform G ε) :
    (increment hP G ε).parts.card = stepBound P.parts.card := by
  have hPα' : stepBound P.parts.card ≤ card α :=
    (mul_le_mul_left' (pow_le_pow_left' (by norm_num) _) _).trans hPα
  have hPpos : 0 < stepBound P.parts.card := stepBound_pos (nonempty_of_not_uniform hPG).card_pos
  rw [increment, card_bind]
  

Proof state:
α : Type u_1
inst✝ : Fintype α
P : Finpartition univ
hP : IsEquipartition P
G : SimpleGraph α
ε : ℝ
hPα : Finset.card P.parts * 16 ^ Finset.card P.parts ≤ Fintype.card α
hPG : ¬Finpartition.IsUniform P G ε
hPα' : stepBound (Finset.card P.parts) ≤ Fintype.card α
hPpos : 0 < stepBound (Finset.card P.parts)
⊢ ∑ A in attach P.parts, Finset.card (chunk hP G ε (_ : ↑A ∈ P.parts)).parts = stepBound (Finset.card P.parts)

Next tactic:
simp_rw [chunk, apply_dite Finpartition.parts, apply_dite card, sum_dite]
/-- The increment partition has a prescribed (very big) size in terms of the original partition. -/
theorem card_increment (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α) (hPG : ¬P.IsUniform G ε) :
    (increment hP G ε).parts.card = stepBound P.parts.card := by
  have hPα' : stepBound P.parts.card ≤ card α :=
    (mul_le_mul_left' (pow_le_pow_left' (by norm_num) _) _).trans hPα
  have hPpos : 0 < stepBound P.parts.card := stepBound_pos (nonempty_of_not_uniform hPG).card_pos
  rw [increment, card_bind]
  simp_rw [chunk, apply_dite Finpartition.parts, apply_dite card, sum_dite]
  

Proof state:
α : Type u_1
inst✝ : Fintype α
P : Finpartition univ
hP : IsEquipartition P
G : SimpleGraph α
ε : ℝ
hPα : Finset.card P.parts * 16 ^ Finset.card P.parts ≤ Fintype.card α
hPG : ¬Finpartition.IsUniform P G ε
hPα' : stepBound (Finset.card P.parts) ≤ Fintype.card α
hPpos : 0 < stepBound (Finset.card P.parts)
⊢ ∑ x in
        attach
          (filter
            (fun x =>
              Finset.card ↑x =
                m * 4 ^ Finset.card P.parts + (Fintype.card α / Finset.card P.parts - m * 4 ^ Finset.card P.parts))
            (attach P.parts)),
        Finset.card
          (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 ↑↑x)).parts +
      ∑ x in
        attach
          (filter
            (fun x =>
              ¬Finset.card ↑x =
                  m * 4 ^ Finset.card P.parts + (Fintype.card α / Finset.card P.parts - m * 4 ^ Finset.card P.parts))
            (attach P.parts)),
        Finset.card
          (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 ↑↑x)).parts =
    stepBound (Finset.card P.parts)

Next tactic:
rw [sum_const_nat, sum_const_nat, card_attach, card_attach]
/-- The increment partition has a prescribed (very big) size in terms of the original partition. -/
theorem card_increment (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α) (hPG : ¬P.IsUniform G ε) :
    (increment hP G ε).parts.card = stepBound P.parts.card := by
  have hPα' : stepBound P.parts.card ≤ card α :=
    (mul_le_mul_left' (pow_le_pow_left' (by norm_num) _) _).trans hPα
  have hPpos : 0 < stepBound P.parts.card := stepBound_pos (nonempty_of_not_uniform hPG).card_pos
  rw [increment, card_bind]
  simp_rw [chunk, apply_dite Finpartition.parts, apply_dite card, sum_dite]
  rw [sum_const_nat, sum_const_nat, card_attach, card_attach]; rotate_left
  any_goals 

Proof state:
α : Type u_1
inst✝ : Fintype α
P : Finpartition univ
hP : IsEquipartition P
G : SimpleGraph α
ε : ℝ
hPα : Finset.card P.parts * 16 ^ Finset.card P.parts ≤ Fintype.card α
hPG : ¬Finpartition.IsUniform P G ε
hPα' : stepBound (Finset.card P.parts) ≤ Fintype.card α
hPpos : 0 < stepBound (Finset.card P.parts)
⊢ ℕ

Next tactic:
exact fun x hx => card_parts_equitabilise _ _ (Nat.div_pos hPα' hPpos).ne'
/-- The increment partition has a prescribed (very big) size in terms of the original partition. -/
theorem card_increment (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α) (hPG : ¬P.IsUniform G ε) :
    (increment hP G ε).parts.card = stepBound P.parts.card := by
  have hPα' : stepBound P.parts.card ≤ card α :=
    (mul_le_mul_left' (pow_le_pow_left' (by norm_num) _) _).trans hPα
  have hPpos : 0 < stepBound P.parts.card := stepBound_pos (nonempty_of_not_uniform hPG).card_pos
  rw [increment, card_bind]
  simp_rw [chunk, apply_dite Finpartition.parts, apply_dite card, sum_dite]
  rw [sum_const_nat, sum_const_nat, card_attach, card_attach]; rotate_left
  any_goals 

Proof state:
α : Type u_1
inst✝ : Fintype α
P : Finpartition univ
hP : IsEquipartition P
G : SimpleGraph α
ε : ℝ
hPα : Finset.card P.parts * 16 ^ Finset.card P.parts ≤ Fintype.card α
hPG : ¬Finpartition.IsUniform P G ε
hPα' : stepBound (Finset.card P.parts) ≤ Fintype.card α
hPpos : 0 < stepBound (Finset.card P.parts)
⊢ ∀
    x ∈
      attach
        (filter
          (fun x =>
            ¬Finset.card ↑x =
                m * 4 ^ Finset.card P.parts + (Fintype.card α / Finset.card P.parts - m * 4 ^ Finset.card P.parts))
          (attach P.parts)),
    Finset.card
        (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 ↑↑x)).parts =
      ?m.205439

Next tactic:
exact fun x hx => card_parts_equitabilise _ _ (Nat.div_pos hPα' hPpos).ne'
/-- The increment partition has a prescribed (very big) size in terms of the original partition. -/
theorem card_increment (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α) (hPG : ¬P.IsUniform G ε) :
    (increment hP G ε).parts.card = stepBound P.parts.card := by
  have hPα' : stepBound P.parts.card ≤ card α :=
    (mul_le_mul_left' (pow_le_pow_left' (by norm_num) _) _).trans hPα
  have hPpos : 0 < stepBound P.parts.card := stepBound_pos (nonempty_of_not_uniform hPG).card_pos
  rw [increment, card_bind]
  simp_rw [chunk, apply_dite Finpartition.parts, apply_dite card, sum_dite]
  rw [sum_const_nat, sum_const_nat, card_attach, card_attach]; rotate_left
  any_goals 

Proof state:
α : Type u_1
inst✝ : Fintype α
P : Finpartition univ
hP : IsEquipartition P
G : SimpleGraph α
ε : ℝ
hPα : Finset.card P.parts * 16 ^ Finset.card P.parts ≤ Fintype.card α
hPG : ¬Finpartition.IsUniform P G ε
hPα' : stepBound (Finset.card P.parts) ≤ Fintype.card α
hPpos : 0 < stepBound (Finset.card P.parts)
⊢ ∀
    x ∈
      attach
        (filter
          (fun x =>
            Finset.card ↑x =
              m * 4 ^ Finset.card P.parts + (Fintype.card α / Finset.card P.parts - m * 4 ^ Finset.card P.parts))
          (attach P.parts)),
    Finset.card
        (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 ↑↑x)).parts =
      ?m.205381

Next tactic:
exact fun x hx => card_parts_equitabilise _ _ (Nat.div_pos hPα' hPpos).ne'
/-- The increment partition has a prescribed (very big) size in terms of the original partition. -/
theorem card_increment (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α) (hPG : ¬P.IsUniform G ε) :
    (increment hP G ε).parts.card = stepBound P.parts.card := by
  have hPα' : stepBound P.parts.card ≤ card α :=
    (mul_le_mul_left' (pow_le_pow_left' (by norm_num) _) _).trans hPα
  have hPpos : 0 < stepBound P.parts.card := stepBound_pos (nonempty_of_not_uniform hPG).card_pos
  rw [increment, card_bind]
  simp_rw [chunk, apply_dite Finpartition.parts, apply_dite card, sum_dite]
  rw [sum_const_nat, sum_const_nat, card_attach, card_attach]; rotate_left
  any_goals 

Proof state:
α : Type u_1
inst✝ : Fintype α
P : Finpartition univ
hP : IsEquipartition P
G : SimpleGraph α
ε : ℝ
hPα : Finset.card P.parts * 16 ^ Finset.card P.parts ≤ Fintype.card α
hPG : ¬Finpartition.IsUniform P G ε
hPα' : stepBound (Finset.card P.parts) ≤ Fintype.card α
hPpos : 0 < stepBound (Finset.card P.parts)
⊢ Finset.card
          (filter
            (fun x =>
              Finset.card ↑x =
                m * 4 ^ Finset.card P.parts + (Fintype.card α / Finset.card P.parts - m * 4 ^ Finset.card P.parts))
            (attach P.parts)) *
        (4 ^ Finset.card P.parts - (Fintype.card α / Finset.card P.parts - m * 4 ^ Finset.card P.parts) +
          (Fintype.card α / Finset.card P.parts - m * 4 ^ Finset.card P.parts)) +
      Finset.card
          (filter
            (fun x =>
              ¬Finset.card ↑x =
                  m * 4 ^ Finset.card P.parts + (Fintype.card α / Finset.card P.parts - m * 4 ^ Finset.card P.parts))
            (attach P.parts)) *
        (4 ^ Finset.card P.parts - (Fintype.card α / Finset.card P.parts - m * 4 ^ Finset.card P.parts + 1) +
          (Fintype.card α / Finset.card P.parts - m * 4 ^ Finset.card P.parts + 1)) =
    stepBound (Finset.card P.parts)

Next tactic:
exact fun x hx => card_parts_equitabilise _ _ (Nat.div_pos hPα' hPpos).ne'
/-- The increment partition has a prescribed (very big) size in terms of the original partition. -/
theorem card_increment (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α) (hPG : ¬P.IsUniform G ε) :
    (increment hP G ε).parts.card = stepBound P.parts.card := by
  have hPα' : stepBound P.parts.card ≤ card α :=
    (mul_le_mul_left' (pow_le_pow_left' (by norm_num) _) _).trans hPα
  have hPpos : 0 < stepBound P.parts.card := stepBound_pos (nonempty_of_not_uniform hPG).card_pos
  rw [increment, card_bind]
  simp_rw [chunk, apply_dite Finpartition.parts, apply_dite card, sum_dite]
  rw [sum_const_nat, sum_const_nat, card_attach, card_attach]; rotate_left
  any_goals exact fun x hx => card_parts_equitabilise _ _ (Nat.div_pos hPα' hPpos).ne'
  

Proof state:
α : Type u_1
inst✝ : Fintype α
P : Finpartition univ
hP : IsEquipartition P
G : SimpleGraph α
ε : ℝ
hPα : Finset.card P.parts * 16 ^ Finset.card P.parts ≤ Fintype.card α
hPG : ¬Finpartition.IsUniform P G ε
hPα' : stepBound (Finset.card P.parts) ≤ Fintype.card α
hPpos : 0 < stepBound (Finset.card P.parts)
⊢ Finset.card
          (filter
            (fun x =>
              Finset.card ↑x =
                m * 4 ^ Finset.card P.parts + (Fintype.card α / Finset.card P.parts - m * 4 ^ Finset.card P.parts))
            (attach P.parts)) *
        (4 ^ Finset.card P.parts - (Fintype.card α / Finset.card P.parts - m * 4 ^ Finset.card P.parts) +
          (Fintype.card α / Finset.card P.parts - m * 4 ^ Finset.card P.parts)) +
      Finset.card
          (filter
            (fun x =>
              ¬Finset.card ↑x =
                  m * 4 ^ Finset.card P.parts + (Fintype.card α / Finset.card P.parts - m * 4 ^ Finset.card P.parts))
            (attach P.parts)) *
        (4 ^ Finset.card P.parts - (Fintype.card α / Finset.card P.parts - m * 4 ^ Finset.card P.parts + 1) +
          (Fintype.card α / Finset.card P.parts - m * 4 ^ Finset.card P.parts + 1)) =
    stepBound (Finset.card P.parts)

Next tactic:
rw [Nat.sub_add_cancel a_add_one_le_four_pow_parts_card,
    Nat.sub_add_cancel ((Nat.le_succ _).trans a_add_one_le_four_pow_parts_card), ← add_mul]
/-- The increment partition has a prescribed (very big) size in terms of the original partition. -/
theorem card_increment (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α) (hPG : ¬P.IsUniform G ε) :
    (increment hP G ε).parts.card = stepBound P.parts.card := by
  have hPα' : stepBound P.parts.card ≤ card α :=
    (mul_le_mul_left' (pow_le_pow_left' (by norm_num) _) _).trans hPα
  have hPpos : 0 < stepBound P.parts.card := stepBound_pos (nonempty_of_not_uniform hPG).card_pos
  rw [increment, card_bind]
  simp_rw [chunk, apply_dite Finpartition.parts, apply_dite card, sum_dite]
  rw [sum_const_nat, sum_const_nat, card_attach, card_attach]; rotate_left
  any_goals exact fun x hx => card_parts_equitabilise _ _ (Nat.div_pos hPα' hPpos).ne'
  rw [Nat.sub_add_cancel a_add_one_le_four_pow_parts_card,
    Nat.sub_add_cancel ((Nat.le_succ _).trans a_add_one_le_four_pow_parts_card), ← add_mul]
  

Proof state:
α : Type u_1
inst✝ : Fintype α
P : Finpartition univ
hP : IsEquipartition P
G : SimpleGraph α
ε : ℝ
hPα : Finset.card P.parts * 16 ^ Finset.card P.parts ≤ Fintype.card α
hPG : ¬Finpartition.IsUniform P G ε
hPα' : stepBound (Finset.card P.parts) ≤ Fintype.card α
hPpos : 0 < stepBound (Finset.card P.parts)
⊢ (Finset.card
          (filter
            (fun x =>
              Finset.card ↑x =
                m * 4 ^ Finset.card P.parts + (Fintype.card α / Finset.card P.parts - m * 4 ^ Finset.card P.parts))
            (attach P.parts)) +
        Finset.card
          (filter
            (fun x =>
              ¬Finset.card ↑x =
                  m * 4 ^ Finset.card P.parts + (Fintype.card α / Finset.card P.parts - m * 4 ^ Finset.card P.parts))
            (attach P.parts))) *
      4 ^ Finset.card P.parts =
    stepBound (Finset.card P.parts)

Next tactic:
congr
/-- The increment partition has a prescribed (very big) size in terms of the original partition. -/
theorem card_increment (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α) (hPG : ¬P.IsUniform G ε) :
    (increment hP G ε).parts.card = stepBound P.parts.card := by
  have hPα' : stepBound P.parts.card ≤ card α :=
    (mul_le_mul_left' (pow_le_pow_left' (by norm_num) _) _).trans hPα
  have hPpos : 0 < stepBound P.parts.card := stepBound_pos (nonempty_of_not_uniform hPG).card_pos
  rw [increment, card_bind]
  simp_rw [chunk, apply_dite Finpartition.parts, apply_dite card, sum_dite]
  rw [sum_const_nat, sum_const_nat, card_attach, card_attach]; rotate_left
  any_goals exact fun x hx => card_parts_equitabilise _ _ (Nat.div_pos hPα' hPpos).ne'
  rw [Nat.sub_add_cancel a_add_one_le_four_pow_parts_card,
    Nat.sub_add_cancel ((Nat.le_succ _).trans a_add_one_le_four_pow_parts_card), ← add_mul]
  congr
  

Proof state:
case e_a
α : Type u_1
inst✝ : Fintype α
P : Finpartition univ
hP : IsEquipartition P
G : SimpleGraph α
ε : ℝ
hPα : Finset.card P.parts * 16 ^ Finset.card P.parts ≤ Fintype.card α
hPG : ¬Finpartition.IsUniform P G ε
hPα' : stepBound (Finset.card P.parts) ≤ Fintype.card α
hPpos : 0 < stepBound (Finset.card P.parts)
⊢ Finset.card
        (filter
          (fun x =>
            Finset.card ↑x =
              m * 4 ^ Finset.card P.parts + (Fintype.card α / Finset.card P.parts - m * 4 ^ Finset.card P.parts))
          (attach P.parts)) +
      Finset.card
        (filter
          (fun x =>
            ¬Finset.card ↑x =
                m * 4 ^ Finset.card P.parts + (Fintype.card α / Finset.card P.parts - m * 4 ^ Finset.card P.parts))
          (attach P.parts)) =
    Finset.card P.parts

Next tactic:
rw [filter_card_add_filter_neg_card_eq_card, card_attach]
theorem increment_isEquipartition (hP : P.IsEquipartition) (G : SimpleGraph α) (ε : ℝ) :
    (increment hP G ε).IsEquipartition := by
  

Proof state:
α : Type u_1
inst✝ : Fintype α
P : Finpartition univ
hP✝ : IsEquipartition P
G✝ : SimpleGraph α
ε✝ : ℝ
hP : IsEquipartition P
G : SimpleGraph α
ε : ℝ
⊢ IsEquipartition (increment hP G ε)

Next tactic:
simp_rw [IsEquipartition, Set.equitableOn_iff_exists_eq_eq_add_one]
theorem increment_isEquipartition (hP : P.IsEquipartition) (G : SimpleGraph α) (ε : ℝ) :
    (increment hP G ε).IsEquipartition := by
  simp_rw [IsEquipartition, Set.equitableOn_iff_exists_eq_eq_add_one]
  

Proof state:
α : Type u_1
inst✝ : Fintype α
P : Finpartition univ
hP✝ : IsEquipartition P
G✝ : SimpleGraph α
ε✝ : ℝ
hP : IsEquipartition P
G : SimpleGraph α
ε : ℝ
⊢ ∃ b, ∀ a ∈ ↑(increment hP G ε).parts, Finset.card a = b ∨ Finset.card a = b + 1

Next tactic:
refine' ⟨m, fun A hA => _⟩
theorem increment_isEquipartition (hP : P.IsEquipartition) (G : SimpleGraph α) (ε : ℝ) :
    (increment hP G ε).IsEquipartition := by
  simp_rw [IsEquipartition, Set.equitableOn_iff_exists_eq_eq_add_one]
  refine' ⟨m, fun A hA => _⟩
  

Proof state:
α : Type u_1
inst✝ : Fintype α
P : Finpartition univ
hP✝ : IsEquipartition P
G✝ : SimpleGraph α
ε✝ : ℝ
hP : IsEquipartition P
G : SimpleGraph α
ε : ℝ
A : Finset α
hA : A ∈ ↑(increment hP G ε).parts
⊢ Finset.card A = m ∨ Finset.card A = m + 1

Next tactic:
rw [mem_coe, increment, mem_bind] at hA
theorem increment_isEquipartition (hP : P.IsEquipartition) (G : SimpleGraph α) (ε : ℝ) :
    (increment hP G ε).IsEquipartition := by
  simp_rw [IsEquipartition, Set.equitableOn_iff_exists_eq_eq_add_one]
  refine' ⟨m, fun A hA => _⟩
  rw [mem_coe, increment, mem_bind] at hA
  

Proof state:
α : Type u_1
inst✝ : Fintype α
P : Finpartition univ
hP✝ : IsEquipartition P
G✝ : SimpleGraph α
ε✝ : ℝ
hP : IsEquipartition P
G : SimpleGraph α
ε : ℝ
A : Finset α
hA : ∃ A_1, ∃ (hA : A_1 ∈ P.parts), A ∈ (chunk hP G ε hA).parts
⊢ Finset.card A = m ∨ Finset.card A = m + 1

Next tactic:
obtain ⟨U, hU, hA⟩ := hA
theorem increment_isEquipartition (hP : P.IsEquipartition) (G : SimpleGraph α) (ε : ℝ) :
    (increment hP G ε).IsEquipartition := by
  simp_rw [IsEquipartition, Set.equitableOn_iff_exists_eq_eq_add_one]
  refine' ⟨m, fun A hA => _⟩
  rw [mem_coe, increment, mem_bind] at hA
  obtain ⟨U, hU, hA⟩ := hA
  

Proof state:
case intro.intro
α : Type u_1
inst✝ : Fintype α
P : Finpartition univ
hP✝ : IsEquipartition P
G✝ : SimpleGraph α
ε✝ : ℝ
hP : IsEquipartition P
G : SimpleGraph α
ε : ℝ
A U : Finset α
hU : U ∈ P.parts
hA : A ∈ (chunk hP G ε hU).parts
⊢ Finset.card A = m ∨ Finset.card A = m + 1

Next tactic:
exact card_eq_of_mem_parts_chunk hA
private theorem distinct_pairs_increment :
    (P.parts.offDiag.attach.biUnion fun UV =>
      (chunk hP G ε (mem_offDiag.1 UV.2).1).parts ×ˢ
      (chunk hP G ε (mem_offDiag.1 UV.2).2.1).parts) ⊆
    (increment hP G ε).parts.offDiag := by
  

Proof state:
α : Type u_1
inst✝ : Fintype α
P : Finpartition univ
hP : IsEquipartition P
G : SimpleGraph α
ε : ℝ
⊢ (Finset.biUnion (attach (offDiag P.parts)) fun UV =>
      (chunk hP G ε (_ : (↑UV).1 ∈ P.parts)).parts ×ˢ (chunk hP G ε (_ : (↑UV).2 ∈ P.parts)).parts) ⊆
    offDiag (increment hP G ε).parts

Next tactic:
rintro ⟨Ui, Vj⟩