Theorem: HallMarriageTheorem.hall_hard_inductive_step_A
File: Mathlib/Combinatorics/Hall/Finite.lean

tactic: haveI : Nonempty ι := Fintype.card_pos_iff.mp (hn.symm ▸ Nat.succ_pos _)
state_before: ι : Type u
α : Type v
inst✝¹ : DecidableEq α
t : ι → Finset α
inst✝ : Fintype ι
n : ℕ
hn : Fintype.card ι = n + 1
ht : ∀ (s : Finset ι), card s ≤ card (Finset.biUnion s t)
ih :
  ∀ {ι' : Type u} [inst : Fintype ι'] (t' : ι' → Finset α),
    Fintype.card ι' ≤ n →
      (∀ (s' : Finset ι'), card s' ≤ card (Finset.biUnion s' t')) → ∃ f, Function.Injective f ∧ ∀ (x : ι'), f x ∈ t' x
ha : ∀ (s : Finset ι), Finset.Nonempty s → s ≠ univ → card s < card (Finset.biUnion s t)
⊢ ∃ f, Function.Injective f ∧ ∀ (x : ι), f x ∈ t x

tactic: haveI := Classical.decEq ι
state_before: ι : Type u
α : Type v
inst✝¹ : DecidableEq α
t : ι → Finset α
inst✝ : Fintype ι
n : ℕ
hn : Fintype.card ι = n + 1
ht : ∀ (s : Finset ι), card s ≤ card (Finset.biUnion s t)
ih :
  ∀ {ι' : Type u} [inst : Fintype ι'] (t' : ι' → Finset α),
    Fintype.card ι' ≤ n →
      (∀ (s' : Finset ι'), card s' ≤ card (Finset.biUnion s' t')) → ∃ f, Function.Injective f ∧ ∀ (x : ι'), f x ∈ t' x
ha : ∀ (s : Finset ι), Finset.Nonempty s → s ≠ univ → card s < card (Finset.biUnion s t)
this : Nonempty ι
⊢ ∃ f, Function.Injective f ∧ ∀ (x : ι), f x ∈ t x

tactic: let x := Classical.arbitrary ι
state_before: ι : Type u
α : Type v
inst✝¹ : DecidableEq α
t : ι → Finset α
inst✝ : Fintype ι
n : ℕ
hn : Fintype.card ι = n + 1
ht : ∀ (s : Finset ι), card s ≤ card (Finset.biUnion s t)
ih :
  ∀ {ι' : Type u} [inst : Fintype ι'] (t' : ι' → Finset α),
    Fintype.card ι' ≤ n →
      (∀ (s' : Finset ι'), card s' ≤ card (Finset.biUnion s' t')) → ∃ f, Function.Injective f ∧ ∀ (x : ι'), f x ∈ t' x
ha : ∀ (s : Finset ι), Finset.Nonempty s → s ≠ univ → card s < card (Finset.biUnion s t)
this✝ : Nonempty ι
this : DecidableEq ι
⊢ ∃ f, Function.Injective f ∧ ∀ (x : ι), f x ∈ t x

tactic: have tx_ne : (t x).Nonempty := by
  rw [← Finset.card_pos]
  calc
    0 < 1 := Nat.one_pos
    _ ≤ (Finset.biUnion {x} t).card := ht {x}
    _ = (t x).card := by rw [Finset.singleton_biUnion]
state_before: ι : Type u
α : Type v
inst✝¹ : DecidableEq α
t : ι → Finset α
inst✝ : Fintype ι
n : ℕ
hn : Fintype.card ι = n + 1
ht : ∀ (s : Finset ι), card s ≤ card (Finset.biUnion s t)
ih :
  ∀ {ι' : Type u} [inst : Fintype ι'] (t' : ι' → Finset α),
    Fintype.card ι' ≤ n →
      (∀ (s' : Finset ι'), card s' ≤ card (Finset.biUnion s' t')) → ∃ f, Function.Injective f ∧ ∀ (x : ι'), f x ∈ t' x
ha : ∀ (s : Finset ι), Finset.Nonempty s → s ≠ univ → card s < card (Finset.biUnion s t)
this✝ : Nonempty ι
this : DecidableEq ι
x : ι := Classical.arbitrary ι
⊢ ∃ f, Function.Injective f ∧ ∀ (x : ι), f x ∈ t x

tactic: choose y hy using tx_ne
state_before: ι : Type u
α : Type v
inst✝¹ : DecidableEq α
t : ι → Finset α
inst✝ : Fintype ι
n : ℕ
hn : Fintype.card ι = n + 1
ht : ∀ (s : Finset ι), card s ≤ card (Finset.biUnion s t)
ih :
  ∀ {ι' : Type u} [inst : Fintype ι'] (t' : ι' → Finset α),
    Fintype.card ι' ≤ n →
      (∀ (s' : Finset ι'), card s' ≤ card (Finset.biUnion s' t')) → ∃ f, Function.Injective f ∧ ∀ (x : ι'), f x ∈ t' x
ha : ∀ (s : Finset ι), Finset.Nonempty s → s ≠ univ → card s < card (Finset.biUnion s t)
this✝ : Nonempty ι
this : DecidableEq ι
x : ι := Classical.arbitrary ι
tx_ne : Finset.Nonempty (t x)
⊢ ∃ f, Function.Injective f ∧ ∀ (x : ι), f x ∈ t x

tactic: let ι' := { x' : ι | x' ≠ x }
state_before: ι : Type u
α : Type v
inst✝¹ : DecidableEq α
t : ι → Finset α
inst✝ : Fintype ι
n : ℕ
hn : Fintype.card ι = n + 1
ht : ∀ (s : Finset ι), card s ≤ card (Finset.biUnion s t)
ih :
  ∀ {ι' : Type u} [inst : Fintype ι'] (t' : ι' → Finset α),
    Fintype.card ι' ≤ n →
      (∀ (s' : Finset ι'), card s' ≤ card (Finset.biUnion s' t')) → ∃ f, Function.Injective f ∧ ∀ (x : ι'), f x ∈ t' x
ha : ∀ (s : Finset ι), Finset.Nonempty s → s ≠ univ → card s < card (Finset.biUnion s t)
this✝ : Nonempty ι
this : DecidableEq ι
x : ι := Classical.arbitrary ι
y : α
hy : y ∈ t x
⊢ ∃ f, Function.Injective f ∧ ∀ (x : ι), f x ∈ t x

tactic: let t' : ι' → Finset α := fun x' => (t x').erase y
state_before: ι : Type u
α : Type v
inst✝¹ : DecidableEq α
t : ι → Finset α
inst✝ : Fintype ι
n : ℕ
hn : Fintype.card ι = n + 1
ht : ∀ (s : Finset ι), card s ≤ card (Finset.biUnion s t)
ih :
  ∀ {ι' : Type u} [inst : Fintype ι'] (t' : ι' → Finset α),
    Fintype.card ι' ≤ n →
      (∀ (s' : Finset ι'), card s' ≤ card (Finset.biUnion s' t')) → ∃ f, Function.Injective f ∧ ∀ (x : ι'), f x ∈ t' x
ha : ∀ (s : Finset ι), Finset.Nonempty s → s ≠ univ → card s < card (Finset.biUnion s t)
this✝ : Nonempty ι
this : DecidableEq ι
x : ι := Classical.arbitrary ι
y : α
hy : y ∈ t x
ι' : Set ι := {x' | x' ≠ x}
⊢ ∃ f, Function.Injective f ∧ ∀ (x : ι), f x ∈ t x

tactic: have card_ι' : Fintype.card ι' = n :=
  calc
    Fintype.card ι' = Fintype.card ι - 1 := Set.card_ne_eq _
    _ = n := by rw [hn, Nat.add_succ_sub_one, add_zero]
state_before: ι : Type u
α : Type v
inst✝¹ : DecidableEq α
t : ι → Finset α
inst✝ : Fintype ι
n : ℕ
hn : Fintype.card ι = n + 1
ht : ∀ (s : Finset ι), card s ≤ card (Finset.biUnion s t)
ih :
  ∀ {ι' : Type u} [inst : Fintype ι'] (t' : ι' → Finset α),
    Fintype.card ι' ≤ n →
      (∀ (s' : Finset ι'), card s' ≤ card (Finset.biUnion s' t')) → ∃ f, Function.Injective f ∧ ∀ (x : ι'), f x ∈ t' x
ha : ∀ (s : Finset ι), Finset.Nonempty s → s ≠ univ → card s < card (Finset.biUnion s t)
this✝ : Nonempty ι
this : DecidableEq ι
x : ι := Classical.arbitrary ι
y : α
hy : y ∈ t x
ι' : Set ι := {x' | x' ≠ x}
t' : ↑ι' → Finset α := fun x' => erase (t ↑x') y
⊢ ∃ f, Function.Injective f ∧ ∀ (x : ι), f x ∈ t x

tactic: rcases ih t' card_ι'.le (hall_cond_of_erase y ha) with ⟨f', hfinj, hfr⟩
state_before: ι : Type u
α : Type v
inst✝¹ : DecidableEq α
t : ι → Finset α
inst✝ : Fintype ι
n : ℕ
hn : Fintype.card ι = n + 1
ht : ∀ (s : Finset ι), card s ≤ card (Finset.biUnion s t)
ih :
  ∀ {ι' : Type u} [inst : Fintype ι'] (t' : ι' → Finset α),
    Fintype.card ι' ≤ n →
      (∀ (s' : Finset ι'), card s' ≤ card (Finset.biUnion s' t')) → ∃ f, Function.Injective f ∧ ∀ (x : ι'), f x ∈ t' x
ha : ∀ (s : Finset ι), Finset.Nonempty s → s ≠ univ → card s < card (Finset.biUnion s t)
this✝ : Nonempty ι
this : DecidableEq ι
x : ι := Classical.arbitrary ι
y : α
hy : y ∈ t x
ι' : Set ι := {x' | x' ≠ x}
t' : ↑ι' → Finset α := fun x' => erase (t ↑x') y
card_ι' : Fintype.card ↑ι' = n
⊢ ∃ f, Function.Injective f ∧ ∀ (x : ι), f x ∈ t x

tactic: refine' ⟨fun z => if h : z = x then y else f' ⟨z, h⟩, _, _⟩
state_before: case intro.intro
ι : Type u
α : Type v
inst✝¹ : DecidableEq α
t : ι → Finset α
inst✝ : Fintype ι
n : ℕ
hn : Fintype.card ι = n + 1
ht : ∀ (s : Finset ι), card s ≤ card (Finset.biUnion s t)
ih :
  ∀ {ι' : Type u} [inst : Fintype ι'] (t' : ι' → Finset α),
    Fintype.card ι' ≤ n →
      (∀ (s' : Finset ι'), card s' ≤ card (Finset.biUnion s' t')) → ∃ f, Function.Injective f ∧ ∀ (x : ι'), f x ∈ t' x
ha : ∀ (s : Finset ι), Finset.Nonempty s → s ≠ univ → card s < card (Finset.biUnion s t)
this✝ : Nonempty ι
this : DecidableEq ι
x : ι := Classical.arbitrary ι
y : α
hy : y ∈ t x
ι' : Set ι := {x' | x' ≠ x}
t' : ↑ι' → Finset α := fun x' => erase (t ↑x') y
card_ι' : Fintype.card ↑ι' = n
f' : ↑ι' → α
hfinj : Function.Injective f'
hfr : ∀ (x : ↑ι'), f' x ∈ t' x
⊢ ∃ f, Function.Injective f ∧ ∀ (x : ι), f x ∈ t x

tactic: rw [← Finset.card_pos]
state_before: ι : Type u
α : Type v
inst✝¹ : DecidableEq α
t : ι → Finset α
inst✝ : Fintype ι
n : ℕ
hn : Fintype.card ι = n + 1
ht : ∀ (s : Finset ι), card s ≤ card (Finset.biUnion s t)
ih :
  ∀ {ι' : Type u} [inst : Fintype ι'] (t' : ι' → Finset α),
    Fintype.card ι' ≤ n →
      (∀ (s' : Finset ι'), card s' ≤ card (Finset.biUnion s' t')) → ∃ f, Function.Injective f ∧ ∀ (x : ι'), f x ∈ t' x
ha : ∀ (s : Finset ι), Finset.Nonempty s → s ≠ univ → card s < card (Finset.biUnion s t)
this✝ : Nonempty ι
this : DecidableEq ι
x : ι := Classical.arbitrary ι
⊢ Finset.Nonempty (t x)

tactic: calc
  0 < 1 := Nat.one_pos
  _ ≤ (Finset.biUnion {x} t).card := ht {x}
  _ = (t x).card := by rw [Finset.singleton_biUnion]
state_before: ι : Type u
α : Type v
inst✝¹ : DecidableEq α
t : ι → Finset α
inst✝ : Fintype ι
n : ℕ
hn : Fintype.card ι = n + 1
ht : ∀ (s : Finset ι), card s ≤ card (Finset.biUnion s t)
ih :
  ∀ {ι' : Type u} [inst : Fintype ι'] (t' : ι' → Finset α),
    Fintype.card ι' ≤ n →
      (∀ (s' : Finset ι'), card s' ≤ card (Finset.biUnion s' t')) → ∃ f, Function.Injective f ∧ ∀ (x : ι'), f x ∈ t' x
ha : ∀ (s : Finset ι), Finset.Nonempty s → s ≠ univ → card s < card (Finset.biUnion s t)
this✝ : Nonempty ι
this : DecidableEq ι
x : ι := Classical.arbitrary ι
⊢ 0 < card (t x)

tactic: rw [Finset.singleton_biUnion]
state_before: ι : Type u
α : Type v
inst✝¹ : DecidableEq α
t : ι → Finset α
inst✝ : Fintype ι
n : ℕ
hn : Fintype.card ι = n + 1
ht : ∀ (s : Finset ι), card s ≤ card (Finset.biUnion s t)
ih :
  ∀ {ι' : Type u} [inst : Fintype ι'] (t' : ι' → Finset α),
    Fintype.card ι' ≤ n →
      (∀ (s' : Finset ι'), card s' ≤ card (Finset.biUnion s' t')) → ∃ f, Function.Injective f ∧ ∀ (x : ι'), f x ∈ t' x
ha : ∀ (s : Finset ι), Finset.Nonempty s → s ≠ univ → card s < card (Finset.biUnion s t)
this✝ : Nonempty ι
this : DecidableEq ι
x : ι := Classical.arbitrary ι
⊢ card (Finset.biUnion {x} t) = card (t x)

tactic: rw [hn, Nat.add_succ_sub_one, add_zero]
state_before: ι : Type u
α : Type v
inst✝¹ : DecidableEq α
t : ι → Finset α
inst✝ : Fintype ι
n : ℕ
hn : Fintype.card ι = n + 1
ht : ∀ (s : Finset ι), card s ≤ card (Finset.biUnion s t)
ih :
  ∀ {ι' : Type u} [inst : Fintype ι'] (t' : ι' → Finset α),
    Fintype.card ι' ≤ n →
      (∀ (s' : Finset ι'), card s' ≤ card (Finset.biUnion s' t')) → ∃ f, Function.Injective f ∧ ∀ (x : ι'), f x ∈ t' x
ha : ∀ (s : Finset ι), Finset.Nonempty s → s ≠ univ → card s < card (Finset.biUnion s t)
this✝ : Nonempty ι
this : DecidableEq ι
x : ι := Classical.arbitrary ι
y : α
hy : y ∈ t x
ι' : Set ι := {x' | x' ≠ x}
t' : ↑ι' → Finset α := fun x' => erase (t ↑x') y
⊢ Fintype.card ι - 1 = n

tactic: rintro z₁ z₂
state_before: case intro.intro.refine'_1
ι : Type u
α : Type v
inst✝¹ : DecidableEq α
t : ι → Finset α
inst✝ : Fintype ι
n : ℕ
hn : Fintype.card ι = n + 1
ht : ∀ (s : Finset ι), card s ≤ card (Finset.biUnion s t)
ih :
  ∀ {ι' : Type u} [inst : Fintype ι'] (t' : ι' → Finset α),
    Fintype.card ι' ≤ n →
      (∀ (s' : Finset ι'), card s' ≤ card (Finset.biUnion s' t')) → ∃ f, Function.Injective f ∧ ∀ (x : ι'), f x ∈ t' x
ha : ∀ (s : Finset ι), Finset.Nonempty s → s ≠ univ → card s < card (Finset.biUnion s t)
this✝ : Nonempty ι
this : DecidableEq ι
x : ι := Classical.arbitrary ι
y : α
hy : y ∈ t x
ι' : Set ι := {x' | x' ≠ x}
t' : ↑ι' → Finset α := fun x' => erase (t ↑x') y
card_ι' : Fintype.card ↑ι' = n
f' : ↑ι' → α
hfinj : Function.Injective f'
hfr : ∀ (x : ↑ι'), f' x ∈ t' x
⊢ Function.Injective fun z => if h : z = x then y else f' { val := z, property := h }

tactic: have key : ∀ {x}, y ≠ f' x := by
  intro x h
  simpa [← h] using hfr x
state_before: case intro.intro.refine'_1
ι : Type u
α : Type v
inst✝¹ : DecidableEq α
t : ι → Finset α
inst✝ : Fintype ι
n : ℕ
hn : Fintype.card ι = n + 1
ht : ∀ (s : Finset ι), card s ≤ card (Finset.biUnion s t)
ih :
  ∀ {ι' : Type u} [inst : Fintype ι'] (t' : ι' → Finset α),
    Fintype.card ι' ≤ n →
      (∀ (s' : Finset ι'), card s' ≤ card (Finset.biUnion s' t')) → ∃ f, Function.Injective f ∧ ∀ (x : ι'), f x ∈ t' x
ha : ∀ (s : Finset ι), Finset.Nonempty s → s ≠ univ → card s < card (Finset.biUnion s t)
this✝ : Nonempty ι
this : DecidableEq ι
x : ι := Classical.arbitrary ι
y : α
hy : y ∈ t x
ι' : Set ι := {x' | x' ≠ x}
t' : ↑ι' → Finset α := fun x' => erase (t ↑x') y
card_ι' : Fintype.card ↑ι' = n
f' : ↑ι' → α
hfinj : Function.Injective f'
hfr : ∀ (x : ↑ι'), f' x ∈ t' x
z₁ z₂ : ι
⊢ (fun z => if h : z = x then y else f' { val := z, property := h }) z₁ =
      (fun z => if h : z = x then y else f' { val := z, property := h }) z₂ →
    z₁ = z₂

tactic: by_cases h₁ : z₁ = x <;> by_cases h₂ : z₂ = x <;> simp [h₁, h₂, hfinj.eq_iff, key, key.symm]
state_before: case intro.intro.refine'_1
ι : Type u
α : Type v
inst✝¹ : DecidableEq α
t : ι → Finset α
inst✝ : Fintype ι
n : ℕ
hn : Fintype.card ι = n + 1
ht : ∀ (s : Finset ι), card s ≤ card (Finset.biUnion s t)
ih :
  ∀ {ι' : Type u} [inst : Fintype ι'] (t' : ι' → Finset α),
    Fintype.card ι' ≤ n →
      (∀ (s' : Finset ι'), card s' ≤ card (Finset.biUnion s' t')) → ∃ f, Function.Injective f ∧ ∀ (x : ι'), f x ∈ t' x
ha : ∀ (s : Finset ι), Finset.Nonempty s → s ≠ univ → card s < card (Finset.biUnion s t)
this✝ : Nonempty ι
this : DecidableEq ι
x : ι := Classical.arbitrary ι
y : α
hy : y ∈ t x
ι' : Set ι := {x' | x' ≠ x}
t' : ↑ι' → Finset α := fun x' => erase (t ↑x') y
card_ι' : Fintype.card ↑ι' = n
f' : ↑ι' → α
hfinj : Function.Injective f'
hfr : ∀ (x : ↑ι'), f' x ∈ t' x
z₁ z₂ : ι
key : ∀ {x : ↑ι'}, y ≠ f' x
⊢ (fun z => if h : z = x then y else f' { val := z, property := h }) z₁ =
      (fun z => if h : z = x then y else f' { val := z, property := h }) z₂ →
    z₁ = z₂

tactic: intro x h
state_before: ι : Type u
α : Type v
inst✝¹ : DecidableEq α
t : ι → Finset α
inst✝ : Fintype ι
n : ℕ
hn : Fintype.card ι = n + 1
ht : ∀ (s : Finset ι), card s ≤ card (Finset.biUnion s t)
ih :
  ∀ {ι' : Type u} [inst : Fintype ι'] (t' : ι' → Finset α),
    Fintype.card ι' ≤ n →
      (∀ (s' : Finset ι'), card s' ≤ card (Finset.biUnion s' t')) → ∃ f, Function.Injective f ∧ ∀ (x : ι'), f x ∈ t' x
ha : ∀ (s : Finset ι), Finset.Nonempty s → s ≠ univ → card s < card (Finset.biUnion s t)
this✝ : Nonempty ι
this : DecidableEq ι
x : ι := Classical.arbitrary ι
y : α
hy : y ∈ t x
ι' : Set ι := {x' | x' ≠ x}
t' : ↑ι' → Finset α := fun x' => erase (t ↑x') y
card_ι' : Fintype.card ↑ι' = n
f' : ↑ι' → α
hfinj : Function.Injective f'
hfr : ∀ (x : ↑ι'), f' x ∈ t' x
z₁ z₂ : ι
⊢ ∀ {x : ↑ι'}, y ≠ f' x

tactic: simpa [← h] using hfr x
state_before: ι : Type u
α : Type v
inst✝¹ : DecidableEq α
t : ι → Finset α
inst✝ : Fintype ι
n : ℕ
hn : Fintype.card ι = n + 1
ht : ∀ (s : Finset ι), card s ≤ card (Finset.biUnion s t)
ih :
  ∀ {ι' : Type u} [inst : Fintype ι'] (t' : ι' → Finset α),
    Fintype.card ι' ≤ n →
      (∀ (s' : Finset ι'), card s' ≤ card (Finset.biUnion s' t')) → ∃ f, Function.Injective f ∧ ∀ (x : ι'), f x ∈ t' x
ha : ∀ (s : Finset ι), Finset.Nonempty s → s ≠ univ → card s < card (Finset.biUnion s t)
this✝ : Nonempty ι
this : DecidableEq ι
x✝ : ι := Classical.arbitrary ι
y : α
hy : y ∈ t x✝
ι' : Set ι := {x' | x' ≠ x✝}
t' : ↑ι' → Finset α := fun x' => erase (t ↑x') y
card_ι' : Fintype.card ↑ι' = n
f' : ↑ι' → α
hfinj : Function.Injective f'
hfr : ∀ (x : ↑ι'), f' x ∈ t' x
z₁ z₂ : ι
x : ↑ι'
h : y = f' x
⊢ False

tactic: intro z
state_before: case intro.intro.refine'_2
ι : Type u
α : Type v
inst✝¹ : DecidableEq α
t : ι → Finset α
inst✝ : Fintype ι
n : ℕ
hn : Fintype.card ι = n + 1
ht : ∀ (s : Finset ι), card s ≤ card (Finset.biUnion s t)
ih :
  ∀ {ι' : Type u} [inst : Fintype ι'] (t' : ι' → Finset α),
    Fintype.card ι' ≤ n →
      (∀ (s' : Finset ι'), card s' ≤ card (Finset.biUnion s' t')) → ∃ f, Function.Injective f ∧ ∀ (x : ι'), f x ∈ t' x
ha : ∀ (s : Finset ι), Finset.Nonempty s → s ≠ univ → card s < card (Finset.biUnion s t)
this✝ : Nonempty ι
this : DecidableEq ι
x : ι := Classical.arbitrary ι
y : α
hy : y ∈ t x
ι' : Set ι := {x' | x' ≠ x}
t' : ↑ι' → Finset α := fun x' => erase (t ↑x') y
card_ι' : Fintype.card ↑ι' = n
f' : ↑ι' → α
hfinj : Function.Injective f'
hfr : ∀ (x : ↑ι'), f' x ∈ t' x
⊢ ∀ (x_1 : ι), (fun z => if h : z = x then y else f' { val := z, property := h }) x_1 ∈ t x_1

tactic: simp only [ne_eq, Set.mem_setOf_eq]
state_before: case intro.intro.refine'_2
ι : Type u
α : Type v
inst✝¹ : DecidableEq α
t : ι → Finset α
inst✝ : Fintype ι
n : ℕ
hn : Fintype.card ι = n + 1
ht : ∀ (s : Finset ι), card s ≤ card (Finset.biUnion s t)
ih :
  ∀ {ι' : Type u} [inst : Fintype ι'] (t' : ι' → Finset α),
    Fintype.card ι' ≤ n →
      (∀ (s' : Finset ι'), card s' ≤ card (Finset.biUnion s' t')) → ∃ f, Function.Injective f ∧ ∀ (x : ι'), f x ∈ t' x
ha : ∀ (s : Finset ι), Finset.Nonempty s → s ≠ univ → card s < card (Finset.biUnion s t)
this✝ : Nonempty ι
this : DecidableEq ι
x : ι := Classical.arbitrary ι
y : α
hy : y ∈ t x
ι' : Set ι := {x' | x' ≠ x}
t' : ↑ι' → Finset α := fun x' => erase (t ↑x') y
card_ι' : Fintype.card ↑ι' = n
f' : ↑ι' → α
hfinj : Function.Injective f'
hfr : ∀ (x : ↑ι'), f' x ∈ t' x
z : ι
⊢ (fun z => if h : z = x then y else f' { val := z, property := h }) z ∈ t z

tactic: split_ifs with hz
state_before: case intro.intro.refine'_2
ι : Type u
α : Type v
inst✝¹ : DecidableEq α
t : ι → Finset α
inst✝ : Fintype ι
n : ℕ
hn : Fintype.card ι = n + 1
ht : ∀ (s : Finset ι), card s ≤ card (Finset.biUnion s t)
ih :
  ∀ {ι' : Type u} [inst : Fintype ι'] (t' : ι' → Finset α),
    Fintype.card ι' ≤ n →
      (∀ (s' : Finset ι'), card s' ≤ card (Finset.biUnion s' t')) → ∃ f, Function.Injective f ∧ ∀ (x : ι'), f x ∈ t' x
ha : ∀ (s : Finset ι), Finset.Nonempty s → s ≠ univ → card s < card (Finset.biUnion s t)
this✝ : Nonempty ι
this : DecidableEq ι
x : ι := Classical.arbitrary ι
y : α
hy : y ∈ t x
ι' : Set ι := {x' | x' ≠ x}
t' : ↑ι' → Finset α := fun x' => erase (t ↑x') y
card_ι' : Fintype.card ↑ι' = n
f' : ↑ι' → α
hfinj : Function.Injective f'
hfr : ∀ (x : ↑ι'), f' x ∈ t' x
z : ι
⊢ (if h : z = Classical.arbitrary ι then y else f' { val := z, property := h }) ∈ t z

tactic: rwa [hz]
state_before: case intro.intro.refine'_2.inl
ι : Type u
α : Type v
inst✝¹ : DecidableEq α
t : ι → Finset α
inst✝ : Fintype ι
n : ℕ
hn : Fintype.card ι = n + 1
ht : ∀ (s : Finset ι), card s ≤ card (Finset.biUnion s t)
ih :
  ∀ {ι' : Type u} [inst : Fintype ι'] (t' : ι' → Finset α),
    Fintype.card ι' ≤ n →
      (∀ (s' : Finset ι'), card s' ≤ card (Finset.biUnion s' t')) → ∃ f, Function.Injective f ∧ ∀ (x : ι'), f x ∈ t' x
ha : ∀ (s : Finset ι), Finset.Nonempty s → s ≠ univ → card s < card (Finset.biUnion s t)
this✝ : Nonempty ι
this : DecidableEq ι
x : ι := Classical.arbitrary ι
y : α
hy : y ∈ t x
ι' : Set ι := {x' | x' ≠ x}
t' : ↑ι' → Finset α := fun x' => erase (t ↑x') y
card_ι' : Fintype.card ↑ι' = n
f' : ↑ι' → α
hfinj : Function.Injective f'
hfr : ∀ (x : ↑ι'), f' x ∈ t' x
z : ι
hz : z = Classical.arbitrary ι
⊢ y ∈ t z

tactic: specialize hfr ⟨z, hz⟩
state_before: case intro.intro.refine'_2.inr
ι : Type u
α : Type v
inst✝¹ : DecidableEq α
t : ι → Finset α
inst✝ : Fintype ι
n : ℕ
hn : Fintype.card ι = n + 1
ht : ∀ (s : Finset ι), card s ≤ card (Finset.biUnion s t)
ih :
  ∀ {ι' : Type u} [inst : Fintype ι'] (t' : ι' → Finset α),
    Fintype.card ι' ≤ n →
      (∀ (s' : Finset ι'), card s' ≤ card (Finset.biUnion s' t')) → ∃ f, Function.Injective f ∧ ∀ (x : ι'), f x ∈ t' x
ha : ∀ (s : Finset ι), Finset.Nonempty s → s ≠ univ → card s < card (Finset.biUnion s t)
this✝ : Nonempty ι
this : DecidableEq ι
x : ι := Classical.arbitrary ι
y : α
hy : y ∈ t x
ι' : Set ι := {x' | x' ≠ x}
t' : ↑ι' → Finset α := fun x' => erase (t ↑x') y
card_ι' : Fintype.card ↑ι' = n
f' : ↑ι' → α
hfinj : Function.Injective f'
hfr : ∀ (x : ↑ι'), f' x ∈ t' x
z : ι
hz : ¬z = Classical.arbitrary ι
⊢ f' { val := z, property := hz } ∈ t z

tactic: rw [mem_erase] at hfr
state_before: case intro.intro.refine'_2.inr
ι : Type u
α : Type v
inst✝¹ : DecidableEq α
t : ι → Finset α
inst✝ : Fintype ι
n : ℕ
hn : Fintype.card ι = n + 1
ht : ∀ (s : Finset ι), card s ≤ card (Finset.biUnion s t)
ih :
  ∀ {ι' : Type u} [inst : Fintype ι'] (t' : ι' → Finset α),
    Fintype.card ι' ≤ n →
      (∀ (s' : Finset ι'), card s' ≤ card (Finset.biUnion s' t')) → ∃ f, Function.Injective f ∧ ∀ (x : ι'), f x ∈ t' x
ha : ∀ (s : Finset ι), Finset.Nonempty s → s ≠ univ → card s < card (Finset.biUnion s t)
this✝ : Nonempty ι
this : DecidableEq ι
x : ι := Classical.arbitrary ι
y : α
hy : y ∈ t x
ι' : Set ι := {x' | x' ≠ x}
t' : ↑ι' → Finset α := fun x' => erase (t ↑x') y
card_ι' : Fintype.card ↑ι' = n
f' : ↑ι' → α
hfinj : Function.Injective f'
z : ι
hz : ¬z = Classical.arbitrary ι
hfr : f' { val := z, property := hz } ∈ t' { val := z, property := hz }
⊢ f' { val := z, property := hz } ∈ t z

tactic: exact hfr.2
state_before: case intro.intro.refine'_2.inr
ι : Type u
α : Type v
inst✝¹ : DecidableEq α
t : ι → Finset α
inst✝ : Fintype ι
n : ℕ
hn : Fintype.card ι = n + 1
ht : ∀ (s : Finset ι), card s ≤ card (Finset.biUnion s t)
ih :
  ∀ {ι' : Type u} [inst : Fintype ι'] (t' : ι' → Finset α),
    Fintype.card ι' ≤ n →
      (∀ (s' : Finset ι'), card s' ≤ card (Finset.biUnion s' t')) → ∃ f, Function.Injective f ∧ ∀ (x : ι'), f x ∈ t' x
ha : ∀ (s : Finset ι), Finset.Nonempty s → s ≠ univ → card s < card (Finset.biUnion s t)
this✝ : Nonempty ι
this : DecidableEq ι
x : ι := Classical.arbitrary ι
y : α
hy : y ∈ t x
ι' : Set ι := {x' | x' ≠ x}
t' : ↑ι' → Finset α := fun x' => erase (t ↑x') y
card_ι' : Fintype.card ↑ι' = n
f' : ↑ι' → α
hfinj : Function.Injective f'
z : ι
hz : ¬z = Classical.arbitrary ι
hfr : f' { val := z, property := hz } ≠ y ∧ f' { val := z, property := hz } ∈ t ↑{ val := z, property := hz }
⊢ f' { val := z, property := hz } ∈ t z