Theorem: finite_memPartition
File: Mathlib/Data/Set/MemPartition.lean

tactic: induction n with
| zero => simp
| succ n ih =>
  rw [memPartition_succ]
  have : Finite (memPartition f n) := Set.finite_coe_iff.mp ih
  rw [← Set.finite_coe_iff]
  simp_rw [setOf_exists, ← exists_prop, setOf_exists, setOf_or]
  refine Finite.Set.finite_biUnion (memPartition f n) _ (fun u _ ↦ ?_)
  rw [Set.finite_coe_iff]
  simp
state_before: α : Type u_1
f : ℕ → Set α
n : ℕ
⊢ (memPartition f n).Finite
state_after: no goals

tactic: simp
state_before: case zero
α : Type u_1
f : ℕ → Set α
⊢ (memPartition f 0).Finite
state_after: no goals

tactic: rw [memPartition_succ]
state_before: case succ
α : Type u_1
f : ℕ → Set α
n : ℕ
ih : (memPartition f n).Finite
⊢ (memPartition f (n + 1)).Finite
state_after: case succ
α : Type u_1
f : ℕ → Set α
n : ℕ
ih : (memPartition f n).Finite
⊢ {s | ∃ u ∈ memPartition f n, s = u ∩ f n ∨ s = u \ f n}.Finite

tactic: have : Finite (memPartition f n) := Set.finite_coe_iff.mp ih
state_before: case succ
α : Type u_1
f : ℕ → Set α
n : ℕ
ih : (memPartition f n).Finite
⊢ {s | ∃ u ∈ memPartition f n, s = u ∩ f n ∨ s = u \ f n}.Finite
state_after: case succ
α : Type u_1
f : ℕ → Set α
n : ℕ
ih : (memPartition f n).Finite
this : Finite ↑(memPartition f n)
⊢ {s | ∃ u ∈ memPartition f n, s = u ∩ f n ∨ s = u \ f n}.Finite

tactic: rw [← Set.finite_coe_iff]
state_before: case succ
α : Type u_1
f : ℕ → Set α
n : ℕ
ih : (memPartition f n).Finite
this : Finite ↑(memPartition f n)
⊢ {s | ∃ u ∈ memPartition f n, s = u ∩ f n ∨ s = u \ f n}.Finite
state_after: case succ
α : Type u_1
f : ℕ → Set α
n : ℕ
ih : (memPartition f n).Finite
this : Finite ↑(memPartition f n)
⊢ Finite ↑{s | ∃ u ∈ memPartition f n, s = u ∩ f n ∨ s = u \ f n}

tactic: simp_rw [setOf_exists, ← exists_prop, setOf_exists, setOf_or]
state_before: case succ
α : Type u_1
f : ℕ → Set α
n : ℕ
ih : (memPartition f n).Finite
this : Finite ↑(memPartition f n)
⊢ Finite ↑{s | ∃ u ∈ memPartition f n, s = u ∩ f n ∨ s = u \ f n}
state_after: case succ
α : Type u_1
f : ℕ → Set α
n : ℕ
ih : (memPartition f n).Finite
this : Finite ↑(memPartition f n)
⊢ Finite ↑(⋃ i ∈ memPartition f n, {a | a = i ∩ f n} ∪ {a | a = i \ f n})

tactic: refine Finite.Set.finite_biUnion (memPartition f n) _ (fun u _ ↦ ?_)
state_before: case succ
α : Type u_1
f : ℕ → Set α
n : ℕ
ih : (memPartition f n).Finite
this : Finite ↑(memPartition f n)
⊢ Finite ↑(⋃ i ∈ memPartition f n, {a | a = i ∩ f n} ∪ {a | a = i \ f n})
state_after: case succ
α : Type u_1
f : ℕ → Set α
n : ℕ
ih : (memPartition f n).Finite
this : Finite ↑(memPartition f n)
u : Set α
x✝ : u ∈ memPartition f n
⊢ Finite ↑({a | a = u ∩ f n} ∪ {a | a = u \ f n})

tactic: rw [Set.finite_coe_iff]
state_before: case succ
α : Type u_1
f : ℕ → Set α
n : ℕ
ih : (memPartition f n).Finite
this : Finite ↑(memPartition f n)
u : Set α
x✝ : u ∈ memPartition f n
⊢ Finite ↑({a | a = u ∩ f n} ∪ {a | a = u \ f n})
state_after: case succ
α : Type u_1
f : ℕ → Set α
n : ℕ
ih : (memPartition f n).Finite
this : Finite ↑(memPartition f n)
u : Set α
x✝ : u ∈ memPartition f n
⊢ ({a | a = u ∩ f n} ∪ {a | a = u \ f n}).Finite

tactic: simp
state_before: case succ
α : Type u_1
f : ℕ → Set α
n : ℕ
ih : (memPartition f n).Finite
this : Finite ↑(memPartition f n)
u : Set α
x✝ : u ∈ memPartition f n
⊢ ({a | a = u ∩ f n} ∪ {a | a = u \ f n}).Finite
state_after: no goals