Theorem: Cardinal.le_range_of_union_finset_eq_top
File: Mathlib/SetTheory/Cardinal/Cofinality.lean

tactic: have k : _root_.Infinite (range f) := by
  rw [infinite_coe_iff]
  apply mt (union_finset_finite_of_range_finite f)
  rw [w]
  exact infinite_univ
state_before: α✝ : Type ?u.149865
r : α✝ → α✝ → Prop
α : Type u_1
β : Type u_2
inst✝ : Infinite β
f : α → Finset β
w : (⋃ (a : α), ↑(f a)) = ⊤
⊢ (#β) ≤ (#↑(range f))

tactic: by_contra h
state_before: α✝ : Type ?u.149865
r : α✝ → α✝ → Prop
α : Type u_1
β : Type u_2
inst✝ : Infinite β
f : α → Finset β
w : (⋃ (a : α), ↑(f a)) = ⊤
k : Infinite ↑(range f)
⊢ (#β) ≤ (#↑(range f))

tactic: simp only [not_le] at h
state_before: α✝ : Type ?u.149865
r : α✝ → α✝ → Prop
α : Type u_1
β : Type u_2
inst✝ : Infinite β
f : α → Finset β
w : (⋃ (a : α), ↑(f a)) = ⊤
k : Infinite ↑(range f)
h : ¬(#β) ≤ (#↑(range f))
⊢ False

tactic: let u : ∀ b, ∃ a, b ∈ f a := fun b => by simpa using (w.ge : _) (Set.mem_univ b)
state_before: α✝ : Type ?u.149865
r : α✝ → α✝ → Prop
α : Type u_1
β : Type u_2
inst✝ : Infinite β
f : α → Finset β
w : (⋃ (a : α), ↑(f a)) = ⊤
k : Infinite ↑(range f)
h : (#↑(range f)) < (#β)
⊢ False

tactic: let u' : β → range f := fun b => ⟨f (u b).choose, by simp⟩
state_before: α✝ : Type ?u.149865
r : α✝ → α✝ → Prop
α : Type u_1
β : Type u_2
inst✝ : Infinite β
f : α → Finset β
w : (⋃ (a : α), ↑(f a)) = ⊤
k : Infinite ↑(range f)
h : (#↑(range f)) < (#β)
u : ∀ (b : β), ∃ a, b ∈ f a :=
  fun b =>
    Eq.mp
      (Eq.trans Mathlib.Data.Set.Lattice._auxLemma.3
        (congrArg Exists (funext fun i => Mathlib.Data.Finset.Basic._auxLemma.4)))
      (Eq.ge w (mem_univ b))
⊢ False

tactic: have v' : ∀ a, u' ⁻¹' {⟨f a, by simp⟩} ≤ f a := by
  rintro a p m
  simp at m
  rw [← m]
  apply fun b => (u b).choose_spec
state_before: α✝ : Type ?u.149865
r : α✝ → α✝ → Prop
α : Type u_1
β : Type u_2
inst✝ : Infinite β
f : α → Finset β
w : (⋃ (a : α), ↑(f a)) = ⊤
k : Infinite ↑(range f)
h : (#↑(range f)) < (#β)
u : ∀ (b : β), ∃ a, b ∈ f a :=
  fun b =>
    Eq.mp
      (Eq.trans Mathlib.Data.Set.Lattice._auxLemma.3
        (congrArg Exists (funext fun i => Mathlib.Data.Finset.Basic._auxLemma.4)))
      (Eq.ge w (mem_univ b))
u' : β → ↑(range f) :=
  fun b =>
    { val := f (Exists.choose (_ : ∃ a, b ∈ f a)), property := (_ : f (Exists.choose (_ : ∃ a, b ∈ f a)) ∈ range f) }
⊢ False

tactic: obtain ⟨⟨-, ⟨a, rfl⟩⟩, p⟩ := exists_infinite_fiber u' h k
state_before: α✝ : Type ?u.149865
r : α✝ → α✝ → Prop
α : Type u_1
β : Type u_2
inst✝ : Infinite β
f : α → Finset β
w : (⋃ (a : α), ↑(f a)) = ⊤
k : Infinite ↑(range f)
h : (#↑(range f)) < (#β)
u : ∀ (b : β), ∃ a, b ∈ f a :=
  fun b =>
    Eq.mp
      (Eq.trans Mathlib.Data.Set.Lattice._auxLemma.3
        (congrArg Exists (funext fun i => Mathlib.Data.Finset.Basic._auxLemma.4)))
      (Eq.ge w (mem_univ b))
u' : β → ↑(range f) :=
  fun b =>
    { val := f (Exists.choose (_ : ∃ a, b ∈ f a)), property := (_ : f (Exists.choose (_ : ∃ a, b ∈ f a)) ∈ range f) }
v' : ∀ (a : α), u' ⁻¹' {{ val := f a, property := (_ : f a ∈ range f) }} ≤ ↑(f a)
⊢ False

tactic: exact (@Infinite.of_injective _ _ p (inclusion (v' a)) (inclusion_injective _)).false
state_before: case intro.mk.intro
α✝ : Type ?u.149865
r : α✝ → α✝ → Prop
α : Type u_1
β : Type u_2
inst✝ : Infinite β
f : α → Finset β
w : (⋃ (a : α), ↑(f a)) = ⊤
k : Infinite ↑(range f)
h : (#↑(range f)) < (#β)
u : ∀ (b : β), ∃ a, b ∈ f a :=
  fun b =>
    Eq.mp
      (Eq.trans Mathlib.Data.Set.Lattice._auxLemma.3
        (congrArg Exists (funext fun i => Mathlib.Data.Finset.Basic._auxLemma.4)))
      (Eq.ge w (mem_univ b))
u' : β → ↑(range f) :=
  fun b =>
    { val := f (Exists.choose (_ : ∃ a, b ∈ f a)), property := (_ : f (Exists.choose (_ : ∃ a, b ∈ f a)) ∈ range f) }
v' : ∀ (a : α), u' ⁻¹' {{ val := f a, property := (_ : f a ∈ range f) }} ≤ ↑(f a)
a : α
p : Infinite ↑(u' ⁻¹' {{ val := f a, property := (_ : ∃ y, f y = f a) }})
⊢ False

tactic: rw [infinite_coe_iff]
state_before: α✝ : Type ?u.149865
r : α✝ → α✝ → Prop
α : Type u_1
β : Type u_2
inst✝ : Infinite β
f : α → Finset β
w : (⋃ (a : α), ↑(f a)) = ⊤
⊢ Infinite ↑(range f)

tactic: apply mt (union_finset_finite_of_range_finite f)
state_before: α✝ : Type ?u.149865
r : α✝ → α✝ → Prop
α : Type u_1
β : Type u_2
inst✝ : Infinite β
f : α → Finset β
w : (⋃ (a : α), ↑(f a)) = ⊤
⊢ Set.Infinite (range f)

tactic: rw [w]
state_before: α✝ : Type ?u.149865
r : α✝ → α✝ → Prop
α : Type u_1
β : Type u_2
inst✝ : Infinite β
f : α → Finset β
w : (⋃ (a : α), ↑(f a)) = ⊤
⊢ ¬Set.Finite (⋃ (a : α), ↑(f a))

tactic: exact infinite_univ
state_before: α✝ : Type ?u.149865
r : α✝ → α✝ → Prop
α : Type u_1
β : Type u_2
inst✝ : Infinite β
f : α → Finset β
w : (⋃ (a : α), ↑(f a)) = ⊤
⊢ ¬Set.Finite ⊤

tactic: simpa using (w.ge : _) (Set.mem_univ b)
state_before: α✝ : Type ?u.149865
r : α✝ → α✝ → Prop
α : Type u_1
β : Type u_2
inst✝ : Infinite β
f : α → Finset β
w : (⋃ (a : α), ↑(f a)) = ⊤
k : Infinite ↑(range f)
h : (#↑(range f)) < (#β)
b : β
⊢ ∃ a, b ∈ f a

tactic: simp
state_before: α✝ : Type ?u.149865
r : α✝ → α✝ → Prop
α : Type u_1
β : Type u_2
inst✝ : Infinite β
f : α → Finset β
w : (⋃ (a : α), ↑(f a)) = ⊤
k : Infinite ↑(range f)
h : (#↑(range f)) < (#β)
u : ∀ (b : β), ∃ a, b ∈ f a :=
  fun b =>
    Eq.mp
      (Eq.trans Mathlib.Data.Set.Lattice._auxLemma.3
        (congrArg Exists (funext fun i => Mathlib.Data.Finset.Basic._auxLemma.4)))
      (Eq.ge w (mem_univ b))
b : β
⊢ f (Exists.choose (_ : ∃ a, b ∈ f a)) ∈ range f

tactic: simp
state_before: α✝ : Type ?u.149865
r : α✝ → α✝ → Prop
α : Type u_1
β : Type u_2
inst✝ : Infinite β
f : α → Finset β
w : (⋃ (a : α), ↑(f a)) = ⊤
k : Infinite ↑(range f)
h : (#↑(range f)) < (#β)
u : ∀ (b : β), ∃ a, b ∈ f a :=
  fun b =>
    Eq.mp
      (Eq.trans Mathlib.Data.Set.Lattice._auxLemma.3
        (congrArg Exists (funext fun i => Mathlib.Data.Finset.Basic._auxLemma.4)))
      (Eq.ge w (mem_univ b))
u' : β → ↑(range f) :=
  fun b =>
    { val := f (Exists.choose (_ : ∃ a, b ∈ f a)), property := (_ : f (Exists.choose (_ : ∃ a, b ∈ f a)) ∈ range f) }
a : α
⊢ f a ∈ range f

tactic: rintro a p m
state_before: α✝ : Type ?u.149865
r : α✝ → α✝ → Prop
α : Type u_1
β : Type u_2
inst✝ : Infinite β
f : α → Finset β
w : (⋃ (a : α), ↑(f a)) = ⊤
k : Infinite ↑(range f)
h : (#↑(range f)) < (#β)
u : ∀ (b : β), ∃ a, b ∈ f a :=
  fun b =>
    Eq.mp
      (Eq.trans Mathlib.Data.Set.Lattice._auxLemma.3
        (congrArg Exists (funext fun i => Mathlib.Data.Finset.Basic._auxLemma.4)))
      (Eq.ge w (mem_univ b))
u' : β → ↑(range f) :=
  fun b =>
    { val := f (Exists.choose (_ : ∃ a, b ∈ f a)), property := (_ : f (Exists.choose (_ : ∃ a, b ∈ f a)) ∈ range f) }
⊢ ∀ (a : α), u' ⁻¹' {{ val := f a, property := (_ : f a ∈ range f) }} ≤ ↑(f a)

tactic: simp at m
state_before: α✝ : Type ?u.149865
r : α✝ → α✝ → Prop
α : Type u_1
β : Type u_2
inst✝ : Infinite β
f : α → Finset β
w : (⋃ (a : α), ↑(f a)) = ⊤
k : Infinite ↑(range f)
h : (#↑(range f)) < (#β)
u : ∀ (b : β), ∃ a, b ∈ f a :=
  fun b =>
    Eq.mp
      (Eq.trans Mathlib.Data.Set.Lattice._auxLemma.3
        (congrArg Exists (funext fun i => Mathlib.Data.Finset.Basic._auxLemma.4)))
      (Eq.ge w (mem_univ b))
u' : β → ↑(range f) :=
  fun b =>
    { val := f (Exists.choose (_ : ∃ a, b ∈ f a)), property := (_ : f (Exists.choose (_ : ∃ a, b ∈ f a)) ∈ range f) }
a : α
p : β
m : p ∈ u' ⁻¹' {{ val := f a, property := (_ : f a ∈ range f) }}
⊢ p ∈ ↑(f a)

tactic: rw [← m]
state_before: α✝ : Type ?u.149865
r : α✝ → α✝ → Prop
α : Type u_1
β : Type u_2
inst✝ : Infinite β
f : α → Finset β
w : (⋃ (a : α), ↑(f a)) = ⊤
k : Infinite ↑(range f)
h : (#↑(range f)) < (#β)
u : ∀ (b : β), ∃ a, b ∈ f a :=
  fun b =>
    Eq.mp
      (Eq.trans Mathlib.Data.Set.Lattice._auxLemma.3
        (congrArg Exists (funext fun i => Mathlib.Data.Finset.Basic._auxLemma.4)))
      (Eq.ge w (mem_univ b))
u' : β → ↑(range f) :=
  fun b =>
    { val := f (Exists.choose (_ : ∃ a, b ∈ f a)), property := (_ : f (Exists.choose (_ : ∃ a, b ∈ f a)) ∈ range f) }
a : α
p : β
m : f (Exists.choose (_ : ∃ a, p ∈ f a)) = f a
⊢ p ∈ ↑(f a)

tactic: apply fun b => (u b).choose_spec
state_before: α✝ : Type ?u.149865
r : α✝ → α✝ → Prop
α : Type u_1
β : Type u_2
inst✝ : Infinite β
f : α → Finset β
w : (⋃ (a : α), ↑(f a)) = ⊤
k : Infinite ↑(range f)
h : (#↑(range f)) < (#β)
u : ∀ (b : β), ∃ a, b ∈ f a :=
  fun b =>
    Eq.mp
      (Eq.trans Mathlib.Data.Set.Lattice._auxLemma.3
        (congrArg Exists (funext fun i => Mathlib.Data.Finset.Basic._auxLemma.4)))
      (Eq.ge w (mem_univ b))
u' : β → ↑(range f) :=
  fun b =>
    { val := f (Exists.choose (_ : ∃ a, b ∈ f a)), property := (_ : f (Exists.choose (_ : ∃ a, b ∈ f a)) ∈ range f) }
a : α
p : β
m : f (Exists.choose (_ : ∃ a, p ∈ f a)) = f a
⊢ p ∈ ↑(f (Exists.choose (_ : ∃ a, p ∈ f a)))