l3lab/ntp-mathlib huggingface dataset:
theorem toPartENat_mono {c c' : Cardinal} (h : c ≤ c') :
    toPartENat c ≤ toPartENat c' := by
  cases lt_or_ge c ℵ₀ with
  | inl hc =>
    rw [toPartENat_apply_of_lt_aleph0 hc]
    cases lt_or_ge c' ℵ₀ with
    | inl hc' =>
      

Proof state:
case inl.inl
α β : Type u
c✝ : Cardinal.{?u.732655}
c c' : Cardinal.{u_1}
h : c ≤ c'
hc : c < ℵ₀
hc' : c' < ℵ₀
⊢ ↑(toNat c) ≤ toPartENat c'

Next tactic:
rw [toPartENat_apply_of_lt_aleph0 hc', PartENat.coe_le_coe]
theorem toPartENat_mono {c c' : Cardinal} (h : c ≤ c') :
    toPartENat c ≤ toPartENat c' := by
  cases lt_or_ge c ℵ₀ with
  | inl hc =>
    rw [toPartENat_apply_of_lt_aleph0 hc]
    cases lt_or_ge c' ℵ₀ with
    | inl hc' =>
      rw [toPartENat_apply_of_lt_aleph0 hc', PartENat.coe_le_coe]
      

Proof state:
case inl.inl
α β : Type u
c✝ : Cardinal.{?u.732655}
c c' : Cardinal.{u_1}
h : c ≤ c'
hc : c < ℵ₀
hc' : c' < ℵ₀
⊢ toNat c ≤ toNat c'

Next tactic:
exact toNat_le_of_le_of_lt_aleph0 hc' h
theorem toPartENat_mono {c c' : Cardinal} (h : c ≤ c') :
    toPartENat c ≤ toPartENat c' := by
  cases lt_or_ge c ℵ₀ with
  | inl hc =>
    rw [toPartENat_apply_of_lt_aleph0 hc]
    cases lt_or_ge c' ℵ₀ with
    | inl hc' =>
      rw [toPartENat_apply_of_lt_aleph0 hc', PartENat.coe_le_coe]
      exact toNat_le_of_le_of_lt_aleph0 hc' h
    

Proof state:
case inl.inr
α β : Type u
c✝ : Cardinal.{?u.732655}
c c' : Cardinal.{u_1}
h : c ≤ c'
hc : c < ℵ₀
hc' : c' ≥ ℵ₀
⊢ ↑(toNat c) ≤ toPartENat c'

Next tactic:
| inr hc' =>
        rw [toPartENat_apply_of_aleph0_le hc']
        exact le_top
theorem toPartENat_mono {c c' : Cardinal} (h : c ≤ c') :
    toPartENat c ≤ toPartENat c' := by
  cases lt_or_ge c ℵ₀ with
  | inl hc =>
    rw [toPartENat_apply_of_lt_aleph0 hc]
    cases lt_or_ge c' ℵ₀ with
    | inl hc' =>
      rw [toPartENat_apply_of_lt_aleph0 hc', PartENat.coe_le_coe]
      exact toNat_le_of_le_of_lt_aleph0 hc' h
    | inr hc' =>
        

Proof state:
case inl.inr
α β : Type u
c✝ : Cardinal.{?u.732655}
c c' : Cardinal.{u_1}
h : c ≤ c'
hc : c < ℵ₀
hc' : c' ≥ ℵ₀
⊢ ↑(toNat c) ≤ toPartENat c'

Next tactic:
rw [toPartENat_apply_of_aleph0_le hc']
theorem toPartENat_mono {c c' : Cardinal} (h : c ≤ c') :
    toPartENat c ≤ toPartENat c' := by
  cases lt_or_ge c ℵ₀ with
  | inl hc =>
    rw [toPartENat_apply_of_lt_aleph0 hc]
    cases lt_or_ge c' ℵ₀ with
    | inl hc' =>
      rw [toPartENat_apply_of_lt_aleph0 hc', PartENat.coe_le_coe]
      exact toNat_le_of_le_of_lt_aleph0 hc' h
    | inr hc' =>
        rw [toPartENat_apply_of_aleph0_le hc']
        

Proof state:
case inl.inr
α β : Type u
c✝ : Cardinal.{?u.732655}
c c' : Cardinal.{u_1}
h : c ≤ c'
hc : c < ℵ₀
hc' : c' ≥ ℵ₀
⊢ ↑(toNat c) ≤ ⊤

Next tactic:
exact le_top
theorem toPartENat_mono {c c' : Cardinal} (h : c ≤ c') :
    toPartENat c ≤ toPartENat c' := by
  cases lt_or_ge c ℵ₀ with
  | inl hc =>
    rw [toPartENat_apply_of_lt_aleph0 hc]
    cases lt_or_ge c' ℵ₀ with
    | inl hc' =>
      rw [toPartENat_apply_of_lt_aleph0 hc', PartENat.coe_le_coe]
      exact toNat_le_of_le_of_lt_aleph0 hc' h
    | inr hc' =>
        rw [toPartENat_apply_of_aleph0_le hc']
        exact le_top
  

Proof state:
case inr
α β : Type u
c✝ : Cardinal.{?u.732655}
c c' : Cardinal.{u_1}
h : c ≤ c'
hc : c ≥ ℵ₀
⊢ toPartENat c ≤ toPartENat c'

Next tactic:
| inr hc =>
      rw [toPartENat_apply_of_aleph0_le hc,
      toPartENat_apply_of_aleph0_le (le_trans hc h)]
theorem toPartENat_mono {c c' : Cardinal} (h : c ≤ c') :
    toPartENat c ≤ toPartENat c' := by
  cases lt_or_ge c ℵ₀ with
  | inl hc =>
    rw [toPartENat_apply_of_lt_aleph0 hc]
    cases lt_or_ge c' ℵ₀ with
    | inl hc' =>
      rw [toPartENat_apply_of_lt_aleph0 hc', PartENat.coe_le_coe]
      exact toNat_le_of_le_of_lt_aleph0 hc' h
    | inr hc' =>
        rw [toPartENat_apply_of_aleph0_le hc']
        exact le_top
  | inr hc =>
      

Proof state:
case inr
α β : Type u
c✝ : Cardinal.{?u.732655}
c c' : Cardinal.{u_1}
h : c ≤ c'
hc : c ≥ ℵ₀
⊢ toPartENat c ≤ toPartENat c'

Next tactic:
rw [toPartENat_apply_of_aleph0_le hc,
      toPartENat_apply_of_aleph0_le (le_trans hc h)]
theorem toPartENat_lift (c : Cardinal.{v}) : toPartENat (lift.{u, v} c) = toPartENat c := by
  

Proof state:
α β : Type u
c✝ : Cardinal.{?u.750476}
c : Cardinal.{v}
⊢ toPartENat (lift.{u, v} c) = toPartENat c

Next tactic:
cases' lt_or_ge c ℵ₀ with hc hc
theorem toPartENat_lift (c : Cardinal.{v}) : toPartENat (lift.{u, v} c) = toPartENat c := by
  cases' lt_or_ge c ℵ₀ with hc hc
  · 

Proof state:
case inl
α β : Type u
c✝ : Cardinal.{?u.750476}
c : Cardinal.{v}
hc : c < ℵ₀
⊢ toPartENat (lift.{u, v} c) = toPartENat c

Next tactic:
rw [toPartENat_apply_of_lt_aleph0 hc, Cardinal.toPartENat_apply_of_lt_aleph0 _]
theorem toPartENat_lift (c : Cardinal.{v}) : toPartENat (lift.{u, v} c) = toPartENat c := by
  cases' lt_or_ge c ℵ₀ with hc hc
  · rw [toPartENat_apply_of_lt_aleph0 hc, Cardinal.toPartENat_apply_of_lt_aleph0 _]
    

Proof state:
case inl
α β : Type u
c✝ : Cardinal.{?u.750476}
c : Cardinal.{v}
hc : c < ℵ₀
⊢ ↑(toNat (lift.{u, v} c)) = ↑(toNat c)
α β : Type u c✝ : Cardinal.{?u.750476} c : Cardinal.{v} hc : c < ℵ₀ ⊢ lift.{u, v} c < ℵ₀

Next tactic:
simp only [toNat_lift]
theorem toPartENat_lift (c : Cardinal.{v}) : toPartENat (lift.{u, v} c) = toPartENat c := by
  cases' lt_or_ge c ℵ₀ with hc hc
  · rw [toPartENat_apply_of_lt_aleph0 hc, Cardinal.toPartENat_apply_of_lt_aleph0 _]
    simp only [toNat_lift]
    

Proof state:
α β : Type u
c✝ : Cardinal.{?u.750476}
c : Cardinal.{v}
hc : c < ℵ₀
⊢ lift.{u, v} c < ℵ₀

Next tactic:
rw [lift_lt_aleph0]
theorem toPartENat_lift (c : Cardinal.{v}) : toPartENat (lift.{u, v} c) = toPartENat c := by
  cases' lt_or_ge c ℵ₀ with hc hc
  · rw [toPartENat_apply_of_lt_aleph0 hc, Cardinal.toPartENat_apply_of_lt_aleph0 _]
    simp only [toNat_lift]
    rw [lift_lt_aleph0]
    

Proof state:
α β : Type u
c✝ : Cardinal.{?u.750476}
c : Cardinal.{v}
hc : c < ℵ₀
⊢ c < ℵ₀

Next tactic:
exact hc
theorem toPartENat_lift (c : Cardinal.{v}) : toPartENat (lift.{u, v} c) = toPartENat c := by
  cases' lt_or_ge c ℵ₀ with hc hc
  · rw [toPartENat_apply_of_lt_aleph0 hc, Cardinal.toPartENat_apply_of_lt_aleph0 _]
    simp only [toNat_lift]
    rw [lift_lt_aleph0]
    exact hc
  · 

Proof state:
case inr
α β : Type u
c✝ : Cardinal.{?u.750476}
c : Cardinal.{v}
hc : c ≥ ℵ₀
⊢ toPartENat (lift.{u, v} c) = toPartENat c

Next tactic:
rw [toPartENat_apply_of_aleph0_le hc, toPartENat_apply_of_aleph0_le _]
theorem toPartENat_lift (c : Cardinal.{v}) : toPartENat (lift.{u, v} c) = toPartENat c := by
  cases' lt_or_ge c ℵ₀ with hc hc
  · rw [toPartENat_apply_of_lt_aleph0 hc, Cardinal.toPartENat_apply_of_lt_aleph0 _]
    simp only [toNat_lift]
    rw [lift_lt_aleph0]
    exact hc
  · rw [toPartENat_apply_of_aleph0_le hc, toPartENat_apply_of_aleph0_le _]
    

Proof state:
α β : Type u
c✝ : Cardinal.{?u.750476}
c : Cardinal.{v}
hc : c ≥ ℵ₀
⊢ ℵ₀ ≤ lift.{u, v} c

Next tactic:
rw [aleph0_le_lift]
theorem toPartENat_lift (c : Cardinal.{v}) : toPartENat (lift.{u, v} c) = toPartENat c := by
  cases' lt_or_ge c ℵ₀ with hc hc
  · rw [toPartENat_apply_of_lt_aleph0 hc, Cardinal.toPartENat_apply_of_lt_aleph0 _]
    simp only [toNat_lift]
    rw [lift_lt_aleph0]
    exact hc
  · rw [toPartENat_apply_of_aleph0_le hc, toPartENat_apply_of_aleph0_le _]
    rw [aleph0_le_lift]
    

Proof state:
α β : Type u
c✝ : Cardinal.{?u.750476}
c : Cardinal.{v}
hc : c ≥ ℵ₀
⊢ ℵ₀ ≤ c

Next tactic:
exact hc
theorem toPartENat_congr {β : Type v} (e : α ≃ β) : toPartENat #α = toPartENat #β := by
  

Proof state:
α β✝ : Type u
c : Cardinal.{?u.768036}
β : Type v
e : α ≃ β
⊢ toPartENat #α = toPartENat #β

Next tactic:
rw [← toPartENat_lift, lift_mk_eq.{_, _,v}.mpr ⟨e⟩, toPartENat_lift]
theorem mk_toPartENat_eq_coe_card [Fintype α] : toPartENat #α = Fintype.card α := by 

Proof state:
α β : Type u
c : Cardinal.{?u.785294}
inst✝ : Fintype α
⊢ toPartENat #α = ↑(Fintype.card α)

Next tactic:
simp
/-- **König's theorem** -/
theorem sum_lt_prod {ι} (f g : ι → Cardinal) (H : ∀ i, f i < g i) : sum f < prod g :=
  lt_of_not_ge fun ⟨F⟩ => by
    

Proof state:
α β : Type u
c : Cardinal.{?u.795027}
ι : Type u_1
f g : ι → Cardinal.{u_2}
H : ∀ (i : ι), f i < g i
x✝ : sum f ≥ prod g
F : ((i : ι) → Quotient.out (g i)) ↪ (i : ι) × Quotient.out (f i)
⊢ False

Next tactic:
have : Inhabited (∀ i : ι, (g i).out) := by
      refine' ⟨fun i => Classical.choice <| mk_ne_zero_iff.1 _⟩
      rw [mk_out]
      exact (H i).ne_bot
/-- **König's theorem** -/
theorem sum_lt_prod {ι} (f g : ι → Cardinal) (H : ∀ i, f i < g i) : sum f < prod g :=
  lt_of_not_ge fun ⟨F⟩ => by
    have : Inhabited (∀ i : ι, (g i).out) := by
      

Proof state:
α β : Type u
c : Cardinal.{?u.795027}
ι : Type u_1
f g : ι → Cardinal.{u_2}
H : ∀ (i : ι), f i < g i
x✝ : sum f ≥ prod g
F : ((i : ι) → Quotient.out (g i)) ↪ (i : ι) × Quotient.out (f i)
⊢ Inhabited ((i : ι) → Quotient.out (g i))

Next tactic:
refine' ⟨fun i => Classical.choice <| mk_ne_zero_iff.1 _⟩
/-- **König's theorem** -/
theorem sum_lt_prod {ι} (f g : ι → Cardinal) (H : ∀ i, f i < g i) : sum f < prod g :=
  lt_of_not_ge fun ⟨F⟩ => by
    have : Inhabited (∀ i : ι, (g i).out) := by
      refine' ⟨fun i => Classical.choice <| mk_ne_zero_iff.1 _⟩
      

Proof state:
α β : Type u
c : Cardinal.{?u.795027}
ι : Type u_1
f g : ι → Cardinal.{u_2}
H : ∀ (i : ι), f i < g i
x✝ : sum f ≥ prod g
F : ((i : ι) → Quotient.out (g i)) ↪ (i : ι) × Quotient.out (f i)
i : ι
⊢ #(Quotient.out (g i)) ≠ 0

Next tactic:
rw [mk_out]
/-- **König's theorem** -/
theorem sum_lt_prod {ι} (f g : ι → Cardinal) (H : ∀ i, f i < g i) : sum f < prod g :=
  lt_of_not_ge fun ⟨F⟩ => by
    have : Inhabited (∀ i : ι, (g i).out) := by
      refine' ⟨fun i => Classical.choice <| mk_ne_zero_iff.1 _⟩
      rw [mk_out]
      

Proof state:
α β : Type u
c : Cardinal.{?u.795027}
ι : Type u_1
f g : ι → Cardinal.{u_2}
H : ∀ (i : ι), f i < g i
x✝ : sum f ≥ prod g
F : ((i : ι) → Quotient.out (g i)) ↪ (i : ι) × Quotient.out (f i)
i : ι
⊢ g i ≠ 0

Next tactic:
exact (H i).ne_bot
/-- **König's theorem** -/
theorem sum_lt_prod {ι} (f g : ι → Cardinal) (H : ∀ i, f i < g i) : sum f < prod g :=
  lt_of_not_ge fun ⟨F⟩ => by
    have : Inhabited (∀ i : ι, (g i).out) := by
      refine' ⟨fun i => Classical.choice <| mk_ne_zero_iff.1 _⟩
      rw [mk_out]
      exact (H i).ne_bot
    

Proof state:
α β : Type u
c : Cardinal.{?u.795027}
ι : Type u_1
f g : ι → Cardinal.{u_2}
H : ∀ (i : ι), f i < g i
x✝ : sum f ≥ prod g
F : ((i : ι) → Quotient.out (g i)) ↪ (i : ι) × Quotient.out (f i)
this : Inhabited ((i : ι) → Quotient.out (g i))
⊢ False

Next tactic:
let G := invFun F
/-- **König's theorem** -/
theorem sum_lt_prod {ι} (f g : ι → Cardinal) (H : ∀ i, f i < g i) : sum f < prod g :=
  lt_of_not_ge fun ⟨F⟩ => by
    have : Inhabited (∀ i : ι, (g i).out) := by
      refine' ⟨fun i => Classical.choice <| mk_ne_zero_iff.1 _⟩
      rw [mk_out]
      exact (H i).ne_bot
    let G := invFun F
    

Proof state:
α β : Type u
c : Cardinal.{?u.795027}
ι : Type u_1
f g : ι → Cardinal.{u_2}
H : ∀ (i : ι), f i < g i
x✝ : sum f ≥ prod g
F : ((i : ι) → Quotient.out (g i)) ↪ (i : ι) × Quotient.out (f i)
this : Inhabited ((i : ι) → Quotient.out (g i))
G : (i : ι) × Quotient.out (f i) → (i : ι) → Quotient.out (g i) := invFun ⇑F
⊢ False

Next tactic:
have sG : Surjective G := invFun_surjective F.2
/-- **König's theorem** -/
theorem sum_lt_prod {ι} (f g : ι → Cardinal) (H : ∀ i, f i < g i) : sum f < prod g :=
  lt_of_not_ge fun ⟨F⟩ => by
    have : Inhabited (∀ i : ι, (g i).out) := by
      refine' ⟨fun i => Classical.choice <| mk_ne_zero_iff.1 _⟩
      rw [mk_out]
      exact (H i).ne_bot
    let G := invFun F
    have sG : Surjective G := invFun_surjective F.2
    

Proof state:
α β : Type u
c : Cardinal.{?u.795027}
ι : Type u_1
f g : ι → Cardinal.{u_2}
H : ∀ (i : ι), f i < g i
x✝ : sum f ≥ prod g
F : ((i : ι) → Quotient.out (g i)) ↪ (i : ι) × Quotient.out (f i)
this : Inhabited ((i : ι) → Quotient.out (g i))
G : (i : ι) × Quotient.out (f i) → (i : ι) → Quotient.out (g i) := invFun ⇑F
sG : Surjective G
⊢ False

Next tactic:
choose C hc using
      show ∀ i, ∃ b, ∀ a, G ⟨i, a⟩ i ≠ b by
        intro i
        simp only [not_exists.symm, not_forall.symm]
        refine' fun h => (H i).not_le _
        rw [← mk_out (f i), ← mk_out (g i)]
        exact ⟨Embedding.ofSurjective _ h⟩
/-- **König's theorem** -/
theorem sum_lt_prod {ι} (f g : ι → Cardinal) (H : ∀ i, f i < g i) : sum f < prod g :=
  lt_of_not_ge fun ⟨F⟩ => by
    have : Inhabited (∀ i : ι, (g i).out) := by
      refine' ⟨fun i => Classical.choice <| mk_ne_zero_iff.1 _⟩
      rw [mk_out]
      exact (H i).ne_bot
    let G := invFun F
    have sG : Surjective G := invFun_surjective F.2
    choose C hc using
      show ∀ i, ∃ b, ∀ a, G ⟨i, a⟩ i ≠ b by
        

Proof state:
α β : Type u
c : Cardinal.{?u.795027}
ι : Type u_1
f g : ι → Cardinal.{u_2}
H : ∀ (i : ι), f i < g i
x✝ : sum f ≥ prod g
F : ((i : ι) → Quotient.out (g i)) ↪ (i : ι) × Quotient.out (f i)
this : Inhabited ((i : ι) → Quotient.out (g i))
G : (i : ι) × Quotient.out (f i) → (i : ι) → Quotient.out (g i) := invFun ⇑F
sG : Surjective G
⊢ ∀ (i : ι), ∃ b, ∀ (a : Quotient.out (f i)), G { fst := i, snd := a } i ≠ b

Next tactic:
intro i
/-- **König's theorem** -/
theorem sum_lt_prod {ι} (f g : ι → Cardinal) (H : ∀ i, f i < g i) : sum f < prod g :=
  lt_of_not_ge fun ⟨F⟩ => by
    have : Inhabited (∀ i : ι, (g i).out) := by
      refine' ⟨fun i => Classical.choice <| mk_ne_zero_iff.1 _⟩
      rw [mk_out]
      exact (H i).ne_bot
    let G := invFun F
    have sG : Surjective G := invFun_surjective F.2
    choose C hc using
      show ∀ i, ∃ b, ∀ a, G ⟨i, a⟩ i ≠ b by
        intro i
        

Proof state:
α β : Type u
c : Cardinal.{?u.795027}
ι : Type u_1
f g : ι → Cardinal.{u_2}
H : ∀ (i : ι), f i < g i
x✝ : sum f ≥ prod g
F : ((i : ι) → Quotient.out (g i)) ↪ (i : ι) × Quotient.out (f i)
this : Inhabited ((i : ι) → Quotient.out (g i))
G : (i : ι) × Quotient.out (f i) → (i : ι) → Quotient.out (g i) := invFun ⇑F
sG : Surjective G
i : ι
⊢ ∃ b, ∀ (a : Quotient.out (f i)), G { fst := i, snd := a } i ≠ b

Next tactic:
simp only [not_exists.symm, not_forall.symm]
/-- **König's theorem** -/
theorem sum_lt_prod {ι} (f g : ι → Cardinal) (H : ∀ i, f i < g i) : sum f < prod g :=
  lt_of_not_ge fun ⟨F⟩ => by
    have : Inhabited (∀ i : ι, (g i).out) := by
      refine' ⟨fun i => Classical.choice <| mk_ne_zero_iff.1 _⟩
      rw [mk_out]
      exact (H i).ne_bot
    let G := invFun F
    have sG : Surjective G := invFun_surjective F.2
    choose C hc using
      show ∀ i, ∃ b, ∀ a, G ⟨i, a⟩ i ≠ b by
        intro i
        simp only [not_exists.symm, not_forall.symm]
        

Proof state:
α β : Type u
c : Cardinal.{?u.795027}
ι : Type u_1
f g : ι → Cardinal.{u_2}
H : ∀ (i : ι), f i < g i
x✝ : sum f ≥ prod g
F : ((i : ι) → Quotient.out (g i)) ↪ (i : ι) × Quotient.out (f i)
this : Inhabited ((i : ι) → Quotient.out (g i))
G : (i : ι) × Quotient.out (f i) → (i : ι) → Quotient.out (g i) := invFun ⇑F
sG : Surjective G
i : ι
⊢ ¬∀ (x : Quotient.out (g i)), ∃ x_1, invFun ⇑F { fst := i, snd := x_1 } i = x

Next tactic:
refine' fun h => (H i).not_le _
/-- **König's theorem** -/
theorem sum_lt_prod {ι} (f g : ι → Cardinal) (H : ∀ i, f i < g i) : sum f < prod g :=
  lt_of_not_ge fun ⟨F⟩ => by
    have : Inhabited (∀ i : ι, (g i).out) := by
      refine' ⟨fun i => Classical.choice <| mk_ne_zero_iff.1 _⟩
      rw [mk_out]
      exact (H i).ne_bot
    let G := invFun F
    have sG : Surjective G := invFun_surjective F.2
    choose C hc using
      show ∀ i, ∃ b, ∀ a, G ⟨i, a⟩ i ≠ b by
        intro i
        simp only [not_exists.symm, not_forall.symm]
        refine' fun h => (H i).not_le _
        

Proof state:
α β : Type u
c : Cardinal.{?u.795027}
ι : Type u_1
f g : ι → Cardinal.{u_2}
H : ∀ (i : ι), f i < g i
x✝ : sum f ≥ prod g
F : ((i : ι) → Quotient.out (g i)) ↪ (i : ι) × Quotient.out (f i)
this : Inhabited ((i : ι) → Quotient.out (g i))
G : (i : ι) × Quotient.out (f i) → (i : ι) → Quotient.out (g i) := invFun ⇑F
sG : Surjective G
i : ι
h : ∀ (x : Quotient.out (g i)), ∃ x_1, invFun ⇑F { fst := i, snd := x_1 } i = x
⊢ g i ≤ f i

Next tactic:
rw [← mk_out (f i), ← mk_out (g i)]
/-- **König's theorem** -/
theorem sum_lt_prod {ι} (f g : ι → Cardinal) (H : ∀ i, f i < g i) : sum f < prod g :=
  lt_of_not_ge fun ⟨F⟩ => by
    have : Inhabited (∀ i : ι, (g i).out) := by
      refine' ⟨fun i => Classical.choice <| mk_ne_zero_iff.1 _⟩
      rw [mk_out]
      exact (H i).ne_bot
    let G := invFun F
    have sG : Surjective G := invFun_surjective F.2
    choose C hc using
      show ∀ i, ∃ b, ∀ a, G ⟨i, a⟩ i ≠ b by
        intro i
        simp only [not_exists.symm, not_forall.symm]
        refine' fun h => (H i).not_le _
        rw [← mk_out (f i), ← mk_out (g i)]
        

Proof state:
α β : Type u
c : Cardinal.{?u.795027}
ι : Type u_1
f g : ι → Cardinal.{u_2}
H : ∀ (i : ι), f i < g i
x✝ : sum f ≥ prod g
F : ((i : ι) → Quotient.out (g i)) ↪ (i : ι) × Quotient.out (f i)
this : Inhabited ((i : ι) → Quotient.out (g i))
G : (i : ι) × Quotient.out (f i) → (i : ι) → Quotient.out (g i) := invFun ⇑F
sG : Surjective G
i : ι
h : ∀ (x : Quotient.out (g i)), ∃ x_1, invFun ⇑F { fst := i, snd := x_1 } i = x
⊢ #(Quotient.out (g i)) ≤ #(Quotient.out (f i))

Next tactic:
exact ⟨Embedding.ofSurjective _ h⟩
/-- **König's theorem** -/
theorem sum_lt_prod {ι} (f g : ι → Cardinal) (H : ∀ i, f i < g i) : sum f < prod g :=
  lt_of_not_ge fun ⟨F⟩ => by
    have : Inhabited (∀ i : ι, (g i).out) := by
      refine' ⟨fun i => Classical.choice <| mk_ne_zero_iff.1 _⟩
      rw [mk_out]
      exact (H i).ne_bot
    let G := invFun F
    have sG : Surjective G := invFun_surjective F.2
    choose C hc using
      show ∀ i, ∃ b, ∀ a, G ⟨i, a⟩ i ≠ b by
        intro i
        simp only [not_exists.symm, not_forall.symm]
        refine' fun h => (H i).not_le _
        rw [← mk_out (f i), ← mk_out (g i)]
        exact ⟨Embedding.ofSurjective _ h⟩
    

Proof state:
α β : Type u
c : Cardinal.{?u.795027}
ι : Type u_1
f g : ι → Cardinal.{u_2}
H : ∀ (i : ι), f i < g i
x✝ : sum f ≥ prod g
F : ((i : ι) → Quotient.out (g i)) ↪ (i : ι) × Quotient.out (f i)
this : Inhabited ((i : ι) → Quotient.out (g i))
G : (i : ι) × Quotient.out (f i) → (i : ι) → Quotient.out (g i) := invFun ⇑F
sG : Surjective G
C : (i : ι) → Quotient.out (g i)
hc : ∀ (i : ι) (a : Quotient.out (f i)), G { fst := i, snd := a } i ≠ C i
⊢ False

Next tactic:
let ⟨⟨i, a⟩, h⟩ := sG C
/-- **König's theorem** -/
theorem sum_lt_prod {ι} (f g : ι → Cardinal) (H : ∀ i, f i < g i) : sum f < prod g :=
  lt_of_not_ge fun ⟨F⟩ => by
    have : Inhabited (∀ i : ι, (g i).out) := by
      refine' ⟨fun i => Classical.choice <| mk_ne_zero_iff.1 _⟩
      rw [mk_out]
      exact (H i).ne_bot
    let G := invFun F
    have sG : Surjective G := invFun_surjective F.2
    choose C hc using
      show ∀ i, ∃ b, ∀ a, G ⟨i, a⟩ i ≠ b by
        intro i
        simp only [not_exists.symm, not_forall.symm]
        refine' fun h => (H i).not_le _
        rw [← mk_out (f i), ← mk_out (g i)]
        exact ⟨Embedding.ofSurjective _ h⟩
    let ⟨⟨i, a⟩, h⟩ := sG C
    

Proof state:
α β : Type u
c : Cardinal.{?u.795027}
ι : Type u_1
f g : ι → Cardinal.{u_2}
H : ∀ (i : ι), f i < g i
x✝ : sum f ≥ prod g
F : ((i : ι) → Quotient.out (g i)) ↪ (i : ι) × Quotient.out (f i)
this : Inhabited ((i : ι) → Quotient.out (g i))
G : (i : ι) × Quotient.out (f i) → (i : ι) → Quotient.out (g i) := invFun ⇑F
sG : Surjective G
C : (i : ι) → Quotient.out (g i)
hc : ∀ (i : ι) (a : Quotient.out (f i)), G { fst := i, snd := a } i ≠ C i
i : ι
a : Quotient.out (f i)
h : G { fst := i, snd := a } = C
⊢ False

Next tactic:
exact hc i a (congr_fun h _)
@[simp]
theorem mk_vector (α : Type u) (n : ℕ) : #(Vector α n) = #α ^ n :=
  (mk_congr (Equiv.vectorEquivFin α n)).trans <| by 

Proof state:
α✝ β : Type u
c : Cardinal.{?u.808289}
α : Type u
n : ℕ
⊢ #(Fin n → α) = #α ^ n

Next tactic:
simp
theorem mk_list_eq_sum_pow (α : Type u) : #(List α) = sum fun n : ℕ => #α ^ n :=
  calc
    #(List α) = #(Σn, Vector α n) := mk_congr (Equiv.sigmaFiberEquiv List.length).symm
    _ = sum fun n : ℕ => #α ^ n := by 

Proof state:
α✝ β : Type u
c : Cardinal.{?u.813943}
α : Type u
⊢ #((n : ℕ) × Vector α n) = sum fun n => #α ^ n

Next tactic:
simp
theorem mk_emptyCollection_iff {α : Type u} {s : Set α} : #s = 0 ↔ s = ∅ := by
  

Proof state:
α✝ β : Type u
c : Cardinal.{?u.815506}
α : Type u
s : Set α
⊢ #↑s = 0 ↔ s = ∅

Next tactic:
constructor
theorem mk_emptyCollection_iff {α : Type u} {s : Set α} : #s = 0 ↔ s = ∅ := by
  constructor
  · 

Proof state:
case mp
α✝ β : Type u
c : Cardinal.{?u.815506}
α : Type u
s : Set α
⊢ #↑s = 0 → s = ∅

Next tactic:
intro h
theorem mk_emptyCollection_iff {α : Type u} {s : Set α} : #s = 0 ↔ s = ∅ := by
  constructor
  · intro h
    

Proof state:
case mp
α✝ β : Type u
c : Cardinal.{?u.815506}
α : Type u
s : Set α
h : #↑s = 0
⊢ s = ∅

Next tactic:
rw [mk_eq_zero_iff] at h
theorem mk_emptyCollection_iff {α : Type u} {s : Set α} : #s = 0 ↔ s = ∅ := by
  constructor
  · intro h
    rw [mk_eq_zero_iff] at h
    

Proof state:
case mp
α✝ β : Type u
c : Cardinal.{?u.815506}
α : Type u
s : Set α
h : IsEmpty ↑s
⊢ s = ∅

Next tactic:
exact eq_empty_iff_forall_not_mem.2 fun x hx => h.elim' ⟨x, hx⟩
theorem mk_emptyCollection_iff {α : Type u} {s : Set α} : #s = 0 ↔ s = ∅ := by
  constructor
  · intro h
    rw [mk_eq_zero_iff] at h
    exact eq_empty_iff_forall_not_mem.2 fun x hx => h.elim' ⟨x, hx⟩
  · 

Proof state:
case mpr
α✝ β : Type u
c : Cardinal.{?u.815506}
α : Type u
s : Set α
⊢ s = ∅ → #↑s = 0

Next tactic:
rintro rfl
theorem mk_emptyCollection_iff {α : Type u} {s : Set α} : #s = 0 ↔ s = ∅ := by
  constructor
  · intro h
    rw [mk_eq_zero_iff] at h
    exact eq_empty_iff_forall_not_mem.2 fun x hx => h.elim' ⟨x, hx⟩
  · rintro rfl
    

Proof state:
case mpr
α✝ β : Type u
c : Cardinal.{?u.815506}
α : Type u
⊢ #↑∅ = 0

Next tactic:
exact mk_emptyCollection _
lemma lift_mk_le_lift_mk_of_injective {α : Type u} {β : Type v} {f : α → β} (hf : Injective f) :
    Cardinal.lift.{v} (#α) ≤ Cardinal.lift.{u} (#β) := by
  

Proof state:
α✝ β✝ : Type u
c : Cardinal.{?u.817592}
α : Type u
β : Type v
f : α → β
hf : Injective f
⊢ lift.{v, u} #α ≤ lift.{u, v} #β

Next tactic:
rw [← Cardinal.mk_range_eq_of_injective hf]
lemma lift_mk_le_lift_mk_of_injective {α : Type u} {β : Type v} {f : α → β} (hf : Injective f) :
    Cardinal.lift.{v} (#α) ≤ Cardinal.lift.{u} (#β) := by
  rw [← Cardinal.mk_range_eq_of_injective hf]
  

Proof state:
α✝ β✝ : Type u
c : Cardinal.{?u.817592}
α : Type u
β : Type v
f : α → β
hf : Injective f
⊢ lift.{u, v} #↑(range f) ≤ lift.{u, v} #β

Next tactic:
exact Cardinal.lift_le.2 (Cardinal.mk_set_le _)
theorem mk_sUnion_le {α : Type u} (A : Set (Set α)) : #(⋃₀ A) ≤ #A * ⨆ s : A, #s := by
  

Proof state:
α✝ β : Type u
c : Cardinal.{?u.820895}
α : Type u
A : Set (Set α)
⊢ #↑(⋃₀ A) ≤ #↑A * ⨆ s, #↑↑s

Next tactic:
rw [sUnion_eq_iUnion]
theorem mk_sUnion_le {α : Type u} (A : Set (Set α)) : #(⋃₀ A) ≤ #A * ⨆ s : A, #s := by
  rw [sUnion_eq_iUnion]
  

Proof state:
α✝ β : Type u
c : Cardinal.{?u.820895}
α : Type u
A : Set (Set α)
⊢ #↑(⋃ i, ↑i) ≤ #↑A * ⨆ s, #↑↑s

Next tactic:
apply mk_iUnion_le
theorem mk_biUnion_le {ι α : Type u} (A : ι → Set α) (s : Set ι) :
    #(⋃ x ∈ s, A x) ≤ #s * ⨆ x : s, #(A x.1) := by
  

Proof state:
α✝ β : Type u
c : Cardinal.{?u.821574}
ι α : Type u
A : ι → Set α
s : Set ι
⊢ #↑(⋃ x ∈ s, A x) ≤ #↑s * ⨆ x, #↑(A ↑x)

Next tactic:
rw [biUnion_eq_iUnion]
theorem mk_biUnion_le {ι α : Type u} (A : ι → Set α) (s : Set ι) :
    #(⋃ x ∈ s, A x) ≤ #s * ⨆ x : s, #(A x.1) := by
  rw [biUnion_eq_iUnion]
  

Proof state:
α✝ β : Type u
c : Cardinal.{?u.821574}
ι α : Type u
A : ι → Set α
s : Set ι
⊢ #↑(⋃ x, A ↑x) ≤ #↑s * ⨆ x, #↑(A ↑x)

Next tactic:
apply mk_iUnion_le
theorem mk_set_eq_nat_iff_finset {α} {s : Set α} {n : ℕ} :
    #s = n ↔ ∃ t : Finset α, (t : Set α) = s ∧ t.card = n := by
  

Proof state:
α✝ β : Type u
c : Cardinal.{?u.823641}
α : Type u_1
s : Set α
n : ℕ
⊢ #↑s = ↑n ↔ ∃ t, ↑t = s ∧ Finset.card t = n

Next tactic:
constructor
theorem mk_set_eq_nat_iff_finset {α} {s : Set α} {n : ℕ} :
    #s = n ↔ ∃ t : Finset α, (t : Set α) = s ∧ t.card = n := by
  constructor
  · 

Proof state:
case mp
α✝ β : Type u
c : Cardinal.{?u.823641}
α : Type u_1
s : Set α
n : ℕ
⊢ #↑s = ↑n → ∃ t, ↑t = s ∧ Finset.card t = n

Next tactic:
intro h