-- Mathlib/SetTheory/Cardinal/Cofinality.lean
theorem le_range_of_union_finset_eq_top {α β : Type*} [Infinite β] (f : α → Finset β)
    (w : ⋃ a, (f a : Set β) = ⊤) : #β ≤ #(range f)

Proof state:
α : 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.Order.SetNotation._auxLemma.3
        (congrArg Exists (funext fun i => Mathlib.Data.Finset.Defs._auxLemma.6)))
      (Eq.ge w (mem_univ b))
b : β
⊢ f ⋯.choose ∈ range f

Tactic:
simp

Result:
no goals

Proof state:
α : Type u_1
β : Type u_2
inst✝ : Infinite β
f : α → Finset β
w : ⋃ a, ↑(f a) = ⊤
⊢ ¬⊤.Finite

Tactic:
exact infinite_univ

Result:
no goals

Proof state:
α : Type u_1
β : Type u_2
inst✝ : Infinite β
f : α → Finset β
w : ⋃ a, ↑(f a) = ⊤
⊢ (range f).Infinite

Tactic:
apply mt (union_finset_finite_of_range_finite f)

Result:
α : Type u_1
β : Type u_2
inst✝ : Infinite β
f : α → Finset β
w : ⋃ a, ↑(f a) = ⊤
⊢ ¬(⋃ a, ↑(f a)).Finite

Proof state:
case intro.mk.intro
α : 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.Order.SetNotation._auxLemma.3
        (congrArg Exists (funext fun i => Mathlib.Data.Finset.Defs._auxLemma.6)))
      (Eq.ge w (mem_univ b))
u' : β → ↑(range f) := fun b => ⟨f ⋯.choose, ⋯⟩
v' : ∀ (a : α), u' ⁻¹' {⟨f a, ⋯⟩} ≤ ↑(f a)
a : α
p : Infinite ↑(u' ⁻¹' {⟨f a, ⋯⟩})
⊢ False

Tactic:
exact (@Infinite.of_injective _ _ p (inclusion (v' a)) (inclusion_injective _)).false

Result:
no goals

Proof state:
α : 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.Order.SetNotation._auxLemma.3
        (congrArg Exists (funext fun i => Mathlib.Data.Finset.Defs._auxLemma.6)))
      (Eq.ge w (mem_univ b))
u' : β → ↑(range f) := fun b => ⟨f ⋯.choose, ⋯⟩
a : α
p : β
m : p ∈ u' ⁻¹' {⟨f a, ⋯⟩}
⊢ p ∈ ↑(f a)

Tactic:
simp? [u']  at m says simp only [mem_preimage, mem_singleton_iff, Subtype.mk.injEq, u'] at m

Result:
α : 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.Order.SetNotation._auxLemma.3
        (congrArg Exists (funext fun i => Mathlib.Data.Finset.Defs._auxLemma.6)))
      (Eq.ge w (mem_univ b))
u' : β → ↑(range f) := fun b => ⟨f ⋯.choose, ⋯⟩
a : α
p : β
m : f ⋯.choose = f a
⊢ p ∈ ↑(f a)

Proof state:
α : Type u_1
β : Type u_2
inst✝ : Infinite β
f : α → Finset β
w : ⋃ a, ↑(f a) = ⊤
k : Infinite ↑(range f)
h : ¬#β ≤ #↑(range f)
⊢ False

Tactic:
simp only [not_le] at h

Result:
α : Type u_1
β : Type u_2
inst✝ : Infinite β
f : α → Finset β
w : ⋃ a, ↑(f a) = ⊤
k : Infinite ↑(range f)
h : #↑(range f) < #β
⊢ False

Proof state:
α : 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.Order.SetNotation._auxLemma.3
        (congrArg Exists (funext fun i => Mathlib.Data.Finset.Defs._auxLemma.6)))
      (Eq.ge w (mem_univ b))
u' : β → ↑(range f) := fun b => ⟨f ⋯.choose, ⋯⟩
a : α
p : β
m : p ∈ u' ⁻¹' {⟨f a, ⋯⟩}
⊢ p ∈ ↑(f a)

Tactic:
simp only [mem_preimage, mem_singleton_iff, Subtype.mk.injEq, u'] at m

Result:
α : 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.Order.SetNotation._auxLemma.3
        (congrArg Exists (funext fun i => Mathlib.Data.Finset.Defs._auxLemma.6)))
      (Eq.ge w (mem_univ b))
u' : β → ↑(range f) := fun b => ⟨f ⋯.choose, ⋯⟩
a : α
p : β
m : f ⋯.choose = f a
⊢ p ∈ ↑(f a)

Proof state:
α : Type u_1
β : Type u_2
inst✝ : Infinite β
f : α → Finset β
w : ⋃ a, ↑(f a) = ⊤
⊢ #β ≤ #↑(range f)

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

Result:
α : Type u_1
β : Type u_2
inst✝ : Infinite β
f : α → Finset β
w : ⋃ a, ↑(f a) = ⊤
k : Infinite ↑(range f)
⊢ #β ≤ #↑(range f)

Proof state:
α : 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)

Result:
α : 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.Order.SetNotation._auxLemma.3
        (congrArg Exists (funext fun i => Mathlib.Data.Finset.Defs._auxLemma.6)))
      (Eq.ge w (mem_univ b))
⊢ False

Proof state:
α : 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.Order.SetNotation._auxLemma.3
        (congrArg Exists (funext fun i => Mathlib.Data.Finset.Defs._auxLemma.6)))
      (Eq.ge w (mem_univ b))
u' : β → ↑(range f) := fun b => ⟨f ⋯.choose, ⋯⟩
⊢ ∀ (a : α), u' ⁻¹' {⟨f a, ⋯⟩} ≤ ↑(f a)

Tactic:
rintro a p m

Result:
α : 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.Order.SetNotation._auxLemma.3
        (congrArg Exists (funext fun i => Mathlib.Data.Finset.Defs._auxLemma.6)))
      (Eq.ge w (mem_univ b))
u' : β → ↑(range f) := fun b => ⟨f ⋯.choose, ⋯⟩
a : α
p : β
m : p ∈ u' ⁻¹' {⟨f a, ⋯⟩}
⊢ p ∈ ↑(f a)

Proof state:
α : Type u_1
β : Type u_2
inst✝ : Infinite β
f : α → Finset β
w : ⋃ a, ↑(f a) = ⊤
⊢ ¬(⋃ a, ↑(f a)).Finite

Tactic:
rw [w]

Result:
α : Type u_1
β : Type u_2
inst✝ : Infinite β
f : α → Finset β
w : ⋃ a, ↑(f a) = ⊤
⊢ ¬⊤.Finite

Proof state:
α : Type u_1
β : Type u_2
inst✝ : Infinite β
f : α → Finset β
w : ⋃ a, ↑(f a) = ⊤
k : Infinite ↑(range f)
⊢ #β ≤ #↑(range f)

Tactic:
by_contra h

Result:
α : Type u_1
β : Type u_2
inst✝ : Infinite β
f : α → Finset β
w : ⋃ a, ↑(f a) = ⊤
k : Infinite ↑(range f)
h : ¬#β ≤ #↑(range f)
⊢ False

Proof state:
α : 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.Order.SetNotation._auxLemma.3
        (congrArg Exists (funext fun i => Mathlib.Data.Finset.Defs._auxLemma.6)))
      (Eq.ge w (mem_univ b))
u' : β → ↑(range f) := fun b => ⟨f ⋯.choose, ⋯⟩
a : α
p : β
m : f ⋯.choose = f a
⊢ p ∈ ↑(f ⋯.choose)

Tactic:
apply fun b => (u b).choose_spec

Result:
no goals

Proof state:
α : 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.Order.SetNotation._auxLemma.3
        (congrArg Exists (funext fun i => Mathlib.Data.Finset.Defs._auxLemma.6)))
      (Eq.ge w (mem_univ b))
⊢ False

Tactic:
let u' : β → range f := fun b => ⟨f (u b).choose, by simp⟩

Result:
α : 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.Order.SetNotation._auxLemma.3
        (congrArg Exists (funext fun i => Mathlib.Data.Finset.Defs._auxLemma.6)))
      (Eq.ge w (mem_univ b))
u' : β → ↑(range f) := fun b => ⟨f ⋯.choose, ⋯⟩
⊢ False