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_1
r : α✝ → α✝ → Prop
α : Type u_2
β : Type u_3
inst✝ : Infinite β
f : α → Finset β
w : ⋃ a, ↑(f a) = ⊤
⊢ #β ≤ #↑(range f)
state_after: α✝ : Type u_1
r : α✝ → α✝ → Prop
α : Type u_2
β : Type u_3
inst✝ : Infinite β
f : α → Finset β
w : ⋃ a, ↑(f a) = ⊤
k : Infinite ↑(range f)
⊢ #β ≤ #↑(range f)

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

tactic: simp only [not_le] at h
state_before: α✝ : Type u_1
r : α✝ → α✝ → Prop
α : Type u_2
β : Type u_3
inst✝ : Infinite β
f : α → Finset β
w : ⋃ a, ↑(f a) = ⊤
k : Infinite ↑(range f)
h : ¬#β ≤ #↑(range f)
⊢ False
state_after: α✝ : Type u_1
r : α✝ → α✝ → Prop
α : Type u_2
β : Type u_3
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_1
r : α✝ → α✝ → Prop
α : Type u_2
β : Type u_3
inst✝ : Infinite β
f : α → Finset β
w : ⋃ a, ↑(f a) = ⊤
k : Infinite ↑(range f)
h : #↑(range f) < #β
⊢ False
state_after: α✝ : Type u_1
r : α✝ → α✝ → Prop
α : Type u_2
β : Type u_3
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.Basic._auxLemma.6)))
      (Eq.ge w (mem_univ b))
⊢ False

tactic: let u' : β → range f := fun b => ⟨f (u b).choose, by simp⟩
state_before: α✝ : Type u_1
r : α✝ → α✝ → Prop
α : Type u_2
β : Type u_3
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.Basic._auxLemma.6)))
      (Eq.ge w (mem_univ b))
⊢ False
state_after: α✝ : Type u_1
r : α✝ → α✝ → Prop
α : Type u_2
β : Type u_3
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.Basic._auxLemma.6)))
      (Eq.ge w (mem_univ b))
u' : β → ↑(range f) := fun b => ⟨f ⋯.choose, ⋯⟩
⊢ False

tactic: have v' : ∀ a, u' ⁻¹' {⟨f a, by simp⟩} ≤ f a := by
  rintro a p m
  simp? [u']  at m says simp only [mem_preimage, mem_singleton_iff, Subtype.mk.injEq, u'] at m
  rw [← m]
  apply fun b => (u b).choose_spec
state_before: α✝ : Type u_1
r : α✝ → α✝ → Prop
α : Type u_2
β : Type u_3
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.Basic._auxLemma.6)))
      (Eq.ge w (mem_univ b))
u' : β → ↑(range f) := fun b => ⟨f ⋯.choose, ⋯⟩
⊢ False
state_after: α✝ : Type u_1
r : α✝ → α✝ → Prop
α : Type u_2
β : Type u_3
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.Basic._auxLemma.6)))
      (Eq.ge w (mem_univ b))
u' : β → ↑(range f) := fun b => ⟨f ⋯.choose, ⋯⟩
v' : ∀ (a : α), u' ⁻¹' {⟨f a, ⋯⟩} ≤ ↑(f a)
⊢ False

tactic: obtain ⟨⟨-, ⟨a, rfl⟩⟩, p⟩ := exists_infinite_fiber u' h k
state_before: α✝ : Type u_1
r : α✝ → α✝ → Prop
α : Type u_2
β : Type u_3
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.Basic._auxLemma.6)))
      (Eq.ge w (mem_univ b))
u' : β → ↑(range f) := fun b => ⟨f ⋯.choose, ⋯⟩
v' : ∀ (a : α), u' ⁻¹' {⟨f a, ⋯⟩} ≤ ↑(f a)
⊢ False
state_after: case intro.mk.intro
α✝ : Type u_1
r : α✝ → α✝ → Prop
α : Type u_2
β : Type u_3
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.Basic._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
state_before: case intro.mk.intro
α✝ : Type u_1
r : α✝ → α✝ → Prop
α : Type u_2
β : Type u_3
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.Basic._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
state_after: no goals

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

tactic: apply mt (union_finset_finite_of_range_finite f)
state_before: α✝ : Type u_1
r : α✝ → α✝ → Prop
α : Type u_2
β : Type u_3
inst✝ : Infinite β
f : α → Finset β
w : ⋃ a, ↑(f a) = ⊤
⊢ (range f).Infinite
state_after: α✝ : Type u_1
r : α✝ → α✝ → Prop
α : Type u_2
β : Type u_3
inst✝ : Infinite β
f : α → Finset β
w : ⋃ a, ↑(f a) = ⊤
⊢ ¬(⋃ a, ↑(f a)).Finite

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

tactic: exact infinite_univ
state_before: α✝ : Type u_1
r : α✝ → α✝ → Prop
α : Type u_2
β : Type u_3
inst✝ : Infinite β
f : α → Finset β
w : ⋃ a, ↑(f a) = ⊤
⊢ ¬⊤.Finite
state_after: no goals

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

tactic: simp
state_before: α✝ : Type u_1
r : α✝ → α✝ → Prop
α : Type u_2
β : Type u_3
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.Basic._auxLemma.6)))
      (Eq.ge w (mem_univ b))
b : β
⊢ f ⋯.choose ∈ range f
state_after: no goals

tactic: simp
state_before: α✝ : Type u_1
r : α✝ → α✝ → Prop
α : Type u_2
β : Type u_3
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.Basic._auxLemma.6)))
      (Eq.ge w (mem_univ b))
u' : β → ↑(range f) := fun b => ⟨f ⋯.choose, ⋯⟩
a : α
⊢ f a ∈ range f
state_after: no goals

tactic: rintro a p m
state_before: α✝ : Type u_1
r : α✝ → α✝ → Prop
α : Type u_2
β : Type u_3
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.Basic._auxLemma.6)))
      (Eq.ge w (mem_univ b))
u' : β → ↑(range f) := fun b => ⟨f ⋯.choose, ⋯⟩
⊢ ∀ (a : α), u' ⁻¹' {⟨f a, ⋯⟩} ≤ ↑(f a)
state_after: α✝ : Type u_1
r : α✝ → α✝ → Prop
α : Type u_2
β : Type u_3
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.Basic._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
state_before: α✝ : Type u_1
r : α✝ → α✝ → Prop
α : Type u_2
β : Type u_3
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.Basic._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)
state_after: α✝ : Type u_1
r : α✝ → α✝ → Prop
α : Type u_2
β : Type u_3
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.Basic._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)

tactic: rw [← m]
state_before: α✝ : Type u_1
r : α✝ → α✝ → Prop
α : Type u_2
β : Type u_3
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.Basic._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)
state_after: α✝ : Type u_1
r : α✝ → α✝ → Prop
α : Type u_2
β : Type u_3
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.Basic._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
state_before: α✝ : Type u_1
r : α✝ → α✝ → Prop
α : Type u_2
β : Type u_3
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.Basic._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)
state_after: no goals

tactic: simp only [mem_preimage, mem_singleton_iff, Subtype.mk.injEq, u'] at m
state_before: α✝ : Type u_1
r : α✝ → α✝ → Prop
α : Type u_2
β : Type u_3
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.Basic._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)
state_after: α✝ : Type u_1
r : α✝ → α✝ → Prop
α : Type u_2
β : Type u_3
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.Basic._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)