Theorem: Cardinal.sum_lt_prod
File: Mathlib/SetTheory/Cardinal/Basic.lean

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
state_before: α β : Type u
ι : Type u_1
f g : ι → Cardinal
H : ∀ (i : ι), f i < g i
x✝ : sum f ≥ prod g
F : ((i : ι) → Quotient.out (g i)) ↪ (i : ι) × Quotient.out (f i)
⊢ False

tactic: let G := invFun F
state_before: α β : Type u
ι : Type u_1
f g : ι → Cardinal
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

tactic: have sG : Surjective G := invFun_surjective F.2
state_before: α β : Type u
ι : Type u_1
f g : ι → Cardinal
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

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⟩
state_before: α β : Type u
ι : Type u_1
f g : ι → Cardinal
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

tactic: let ⟨⟨i, a⟩, h⟩ := sG C
state_before: α β : Type u
ι : Type u_1
f g : ι → Cardinal
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

tactic: exact hc i a (congr_fun h _)
state_before: α β : Type u
ι : Type u_1
f g : ι → Cardinal
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

tactic: refine' ⟨fun i => Classical.choice <| mk_ne_zero_iff.1 _⟩
state_before: α β : Type u
ι : Type u_1
f g : ι → Cardinal
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))

tactic: rw [mk_out]
state_before: α β : Type u
ι : Type u_1
f g : ι → Cardinal
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

tactic: exact (H i).ne_bot
state_before: α β : Type u
ι : Type u_1
f g : ι → Cardinal
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

tactic: intro i
state_before: α β : Type u
ι : Type u_1
f g : ι → Cardinal
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

tactic: simp only [not_exists.symm, not_forall.symm]
state_before: α β : Type u
ι : Type u_1
f g : ι → Cardinal
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

tactic: refine' fun h => (H i).not_le _
state_before: α β : Type u
ι : Type u_1
f g : ι → Cardinal
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

tactic: rw [← mk_out (f i), ← mk_out (g i)]
state_before: α β : Type u
ι : Type u_1
f g : ι → Cardinal
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

tactic: exact ⟨Embedding.ofSurjective _ h⟩
state_before: α β : Type u
ι : Type u_1
f g : ι → Cardinal
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))