l3lab/ntp-mathlib huggingface dataset:
@[gcongr] theorem add_lt_add (ac : a < c) (bd : b < d) : a + b < c + d := by
  lift a to ℝ≥0 using ac.ne_top
  

Proof state:
case intro
α : Type u_1
β : Type u_2
b c d : ℝ≥0∞
r p q : ℝ≥0
bd : b < d
a : ℝ≥0
ac : ↑a < c
⊢ ↑a + b < c + d

Next tactic:
lift b to ℝ≥0 using bd.ne_top
@[gcongr] theorem add_lt_add (ac : a < c) (bd : b < d) : a + b < c + d := by
  lift a to ℝ≥0 using ac.ne_top
  lift b to ℝ≥0 using bd.ne_top
  

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
c d : ℝ≥0∞
r p q a : ℝ≥0
ac : ↑a < c
b : ℝ≥0
bd : ↑b < d
⊢ ↑a + ↑b < c + d

Next tactic:
cases c
@[gcongr] theorem add_lt_add (ac : a < c) (bd : b < d) : a + b < c + d := by
  lift a to ℝ≥0 using ac.ne_top
  lift b to ℝ≥0 using bd.ne_top
  cases c; · 

Proof state:
case intro.intro.none
α : Type u_1
β : Type u_2
d : ℝ≥0∞
r p q a b : ℝ≥0
bd : ↑b < d
ac : ↑a < none
⊢ ↑a + ↑b < none + d

Next tactic:
simp
@[gcongr] theorem add_lt_add (ac : a < c) (bd : b < d) : a + b < c + d := by
  lift a to ℝ≥0 using ac.ne_top
  lift b to ℝ≥0 using bd.ne_top
  cases c; · simp
  

Proof state:
case intro.intro.some
α : Type u_1
β : Type u_2
d : ℝ≥0∞
r p q a b : ℝ≥0
bd : ↑b < d
val✝ : ℝ≥0
ac : ↑a < some val✝
⊢ ↑a + ↑b < some val✝ + d

Next tactic:
cases d
@[gcongr] theorem add_lt_add (ac : a < c) (bd : b < d) : a + b < c + d := by
  lift a to ℝ≥0 using ac.ne_top
  lift b to ℝ≥0 using bd.ne_top
  cases c; · simp
  cases d; · 

Proof state:
case intro.intro.some.none
α : Type u_1
β : Type u_2
r p q a b val✝ : ℝ≥0
ac : ↑a < some val✝
bd : ↑b < none
⊢ ↑a + ↑b < some val✝ + none

Next tactic:
simp
@[gcongr] theorem add_lt_add (ac : a < c) (bd : b < d) : a + b < c + d := by
  lift a to ℝ≥0 using ac.ne_top
  lift b to ℝ≥0 using bd.ne_top
  cases c; · simp
  cases d; · simp
  

Proof state:
case intro.intro.some.some
α : Type u_1
β : Type u_2
r p q a b val✝¹ : ℝ≥0
ac : ↑a < some val✝¹
val✝ : ℝ≥0
bd : ↑b < some val✝
⊢ ↑a + ↑b < some val✝¹ + some val✝

Next tactic:
simp only [← coe_add, some_eq_coe, coe_lt_coe] at *
@[gcongr] theorem add_lt_add (ac : a < c) (bd : b < d) : a + b < c + d := by
  lift a to ℝ≥0 using ac.ne_top
  lift b to ℝ≥0 using bd.ne_top
  cases c; · simp
  cases d; · simp
  simp only [← coe_add, some_eq_coe, coe_lt_coe] at *
  

Proof state:
case intro.intro.some.some
α : Type u_1
β : Type u_2
r p q a b val✝¹ val✝ : ℝ≥0
ac : a < val✝¹
bd : b < val✝
⊢ a + b < val✝¹ + val✝

Next tactic:
exact add_lt_add ac bd
theorem le_of_top_imp_top_of_toNNReal_le {a b : ℝ≥0∞} (h : a = ⊤ → b = ⊤)
    (h_nnreal : a ≠ ⊤ → b ≠ ⊤ → a.toNNReal ≤ b.toNNReal) : a ≤ b := by
  

Proof state:
α : Type u_1
β : Type u_2
a✝ b✝ c d : ℝ≥0∞
r p q : ℝ≥0
a b : ℝ≥0∞
h : a = ⊤ → b = ⊤
h_nnreal : a ≠ ⊤ → b ≠ ⊤ → ENNReal.toNNReal a ≤ ENNReal.toNNReal b
⊢ a ≤ b

Next tactic:
by_contra! hlt
theorem le_of_top_imp_top_of_toNNReal_le {a b : ℝ≥0∞} (h : a = ⊤ → b = ⊤)
    (h_nnreal : a ≠ ⊤ → b ≠ ⊤ → a.toNNReal ≤ b.toNNReal) : a ≤ b := by
  by_contra! hlt
  

Proof state:
α : Type u_1
β : Type u_2
a✝ b✝ c d : ℝ≥0∞
r p q : ℝ≥0
a b : ℝ≥0∞
h : a = ⊤ → b = ⊤
h_nnreal : a ≠ ⊤ → b ≠ ⊤ → ENNReal.toNNReal a ≤ ENNReal.toNNReal b
hlt : b < a
⊢ False

Next tactic:
lift b to ℝ≥0 using hlt.ne_top
theorem le_of_top_imp_top_of_toNNReal_le {a b : ℝ≥0∞} (h : a = ⊤ → b = ⊤)
    (h_nnreal : a ≠ ⊤ → b ≠ ⊤ → a.toNNReal ≤ b.toNNReal) : a ≤ b := by
  by_contra! hlt
  lift b to ℝ≥0 using hlt.ne_top
  

Proof state:
case intro
α : Type u_1
β : Type u_2
a✝ b✝ c d : ℝ≥0∞
r p q : ℝ≥0
a : ℝ≥0∞
b : ℝ≥0
h : a = ⊤ → ↑b = ⊤
h_nnreal : a ≠ ⊤ → ↑b ≠ ⊤ → ENNReal.toNNReal a ≤ ENNReal.toNNReal ↑b
hlt : ↑b < a
⊢ False

Next tactic:
lift a to ℝ≥0 using mt h coe_ne_top
theorem le_of_top_imp_top_of_toNNReal_le {a b : ℝ≥0∞} (h : a = ⊤ → b = ⊤)
    (h_nnreal : a ≠ ⊤ → b ≠ ⊤ → a.toNNReal ≤ b.toNNReal) : a ≤ b := by
  by_contra! hlt
  lift b to ℝ≥0 using hlt.ne_top
  lift a to ℝ≥0 using mt h coe_ne_top
  

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
a✝ b✝ c d : ℝ≥0∞
r p q b a : ℝ≥0
h : ↑a = ⊤ → ↑b = ⊤
h_nnreal : ↑a ≠ ⊤ → ↑b ≠ ⊤ → ENNReal.toNNReal ↑a ≤ ENNReal.toNNReal ↑b
hlt : ↑b < ↑a
⊢ False

Next tactic:
refine hlt.not_le ?_
theorem le_of_top_imp_top_of_toNNReal_le {a b : ℝ≥0∞} (h : a = ⊤ → b = ⊤)
    (h_nnreal : a ≠ ⊤ → b ≠ ⊤ → a.toNNReal ≤ b.toNNReal) : a ≤ b := by
  by_contra! hlt
  lift b to ℝ≥0 using hlt.ne_top
  lift a to ℝ≥0 using mt h coe_ne_top
  refine hlt.not_le ?_
  

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
a✝ b✝ c d : ℝ≥0∞
r p q b a : ℝ≥0
h : ↑a = ⊤ → ↑b = ⊤
h_nnreal : ↑a ≠ ⊤ → ↑b ≠ ⊤ → ENNReal.toNNReal ↑a ≤ ENNReal.toNNReal ↑b
hlt : ↑b < ↑a
⊢ ↑a ≤ ↑b

Next tactic:
simpa using h_nnreal
@[simp]
theorem abs_toReal {x : ℝ≥0∞} : |x.toReal| = x.toReal := by 

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
x : ℝ≥0∞
⊢ |ENNReal.toReal x| = ENNReal.toReal x

Next tactic:
cases x
@[simp]
theorem abs_toReal {x : ℝ≥0∞} : |x.toReal| = x.toReal := by cases x <;> 

Proof state:
case none
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
⊢ |ENNReal.toReal none| = ENNReal.toReal none

Next tactic:
simp
@[simp]
theorem abs_toReal {x : ℝ≥0∞} : |x.toReal| = x.toReal := by cases x <;> 

Proof state:
case some
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q val✝ : ℝ≥0
⊢ |ENNReal.toReal (some val✝)| = ENNReal.toReal (some val✝)

Next tactic:
simp
theorem coe_mem_upperBounds {s : Set ℝ≥0} :
    ↑r ∈ upperBounds (ofNNReal '' s) ↔ r ∈ upperBounds s := by
  

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
ι : Sort u_3
f : ι → ℝ≥0
s : Set ℝ≥0
⊢ ↑r ∈ upperBounds (ofNNReal '' s) ↔ r ∈ upperBounds s

Next tactic:
simp (config := { contextual := true }) [upperBounds, ball_image_iff, -mem_image, *]
@[mono, gcongr]
theorem mul_lt_mul (ac : a < c) (bd : b < d) : a * b < c * d := by
  

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
ac : a < c
bd : b < d
⊢ a * b < c * d

Next tactic:
rcases lt_iff_exists_nnreal_btwn.1 ac with ⟨a', aa', a'c⟩
@[mono, gcongr]
theorem mul_lt_mul (ac : a < c) (bd : b < d) : a * b < c * d := by
  rcases lt_iff_exists_nnreal_btwn.1 ac with ⟨a', aa', a'c⟩
  

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
ac : a < c
bd : b < d
a' : ℝ≥0
aa' : a < ↑a'
a'c : ↑a' < c
⊢ a * b < c * d

Next tactic:
lift a to ℝ≥0 using ne_top_of_lt aa'
@[mono, gcongr]
theorem mul_lt_mul (ac : a < c) (bd : b < d) : a * b < c * d := by
  rcases lt_iff_exists_nnreal_btwn.1 ac with ⟨a', aa', a'c⟩
  lift a to ℝ≥0 using ne_top_of_lt aa'
  

Proof state:
case intro.intro.intro
α : Type u_1
β : Type u_2
b c d : ℝ≥0∞
r p q : ℝ≥0
bd : b < d
a' : ℝ≥0
a'c : ↑a' < c
a : ℝ≥0
ac : ↑a < c
aa' : ↑a < ↑a'
⊢ ↑a * b < c * d

Next tactic:
rcases lt_iff_exists_nnreal_btwn.1 bd with ⟨b', bb', b'd⟩
@[mono, gcongr]
theorem mul_lt_mul (ac : a < c) (bd : b < d) : a * b < c * d := by
  rcases lt_iff_exists_nnreal_btwn.1 ac with ⟨a', aa', a'c⟩
  lift a to ℝ≥0 using ne_top_of_lt aa'
  rcases lt_iff_exists_nnreal_btwn.1 bd with ⟨b', bb', b'd⟩
  

Proof state:
case intro.intro.intro.intro.intro
α : Type u_1
β : Type u_2
b c d : ℝ≥0∞
r p q : ℝ≥0
bd : b < d
a' : ℝ≥0
a'c : ↑a' < c
a : ℝ≥0
ac : ↑a < c
aa' : ↑a < ↑a'
b' : ℝ≥0
bb' : b < ↑b'
b'd : ↑b' < d
⊢ ↑a * b < c * d

Next tactic:
lift b to ℝ≥0 using ne_top_of_lt bb'
@[mono, gcongr]
theorem mul_lt_mul (ac : a < c) (bd : b < d) : a * b < c * d := by
  rcases lt_iff_exists_nnreal_btwn.1 ac with ⟨a', aa', a'c⟩
  lift a to ℝ≥0 using ne_top_of_lt aa'
  rcases lt_iff_exists_nnreal_btwn.1 bd with ⟨b', bb', b'd⟩
  lift b to ℝ≥0 using ne_top_of_lt bb'
  

Proof state:
case intro.intro.intro.intro.intro.intro
α : Type u_1
β : Type u_2
c d : ℝ≥0∞
r p q a' : ℝ≥0
a'c : ↑a' < c
a : ℝ≥0
ac : ↑a < c
aa' : ↑a < ↑a'
b' : ℝ≥0
b'd : ↑b' < d
b : ℝ≥0
bd : ↑b < d
bb' : ↑b < ↑b'
⊢ ↑a * ↑b < c * d

Next tactic:
norm_cast at *
@[mono, gcongr]
theorem mul_lt_mul (ac : a < c) (bd : b < d) : a * b < c * d := by
  rcases lt_iff_exists_nnreal_btwn.1 ac with ⟨a', aa', a'c⟩
  lift a to ℝ≥0 using ne_top_of_lt aa'
  rcases lt_iff_exists_nnreal_btwn.1 bd with ⟨b', bb', b'd⟩
  lift b to ℝ≥0 using ne_top_of_lt bb'
  norm_cast at *
  

Proof state:
case intro.intro.intro.intro.intro.intro
α : Type u_1
β : Type u_2
c d : ℝ≥0∞
r p q a' : ℝ≥0
a'c : ↑a' < c
a : ℝ≥0
ac : ↑a < c
b' : ℝ≥0
b'd : ↑b' < d
b : ℝ≥0
bd : ↑b < d
aa' : a < a'
bb' : b < b'
⊢ ↑(a * b) < c * d

Next tactic:
calc
    ↑(a * b) < ↑(a' * b') := coe_lt_coe.2 (mul_lt_mul₀ aa' bb')
    _ = ↑a' * ↑b' := coe_mul
    _ ≤ c * d := mul_le_mul' a'c.le b'd.le
theorem pow_strictMono : ∀ {n : ℕ}, n ≠ 0 → StrictMono fun x : ℝ≥0∞ => x ^ n
  | 0, h => absurd rfl h
  | 1, _ => by 

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
x✝ : 1 ≠ 0
⊢ StrictMono fun x => x ^ 1

Next tactic:
simpa only [pow_one] using strictMono_id
theorem mul_left_strictMono (h0 : a ≠ 0) (hinf : a ≠ ∞) : StrictMono (a * ·) := by
  

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
h0 : a ≠ 0
hinf : a ≠ ⊤
⊢ StrictMono fun x => a * x

Next tactic:
lift a to ℝ≥0 using hinf
theorem mul_left_strictMono (h0 : a ≠ 0) (hinf : a ≠ ∞) : StrictMono (a * ·) := by
  lift a to ℝ≥0 using hinf
  

Proof state:
case intro
α : Type u_1
β : Type u_2
b c d : ℝ≥0∞
r p q a : ℝ≥0
h0 : ↑a ≠ 0
⊢ StrictMono fun x => ↑a * x

Next tactic:
rw [coe_ne_zero] at h0
theorem mul_left_strictMono (h0 : a ≠ 0) (hinf : a ≠ ∞) : StrictMono (a * ·) := by
  lift a to ℝ≥0 using hinf
  rw [coe_ne_zero] at h0
  

Proof state:
case intro
α : Type u_1
β : Type u_2
b c d : ℝ≥0∞
r p q a : ℝ≥0
h0 : a ≠ 0
⊢ StrictMono fun x => ↑a * x

Next tactic:
intro x y h
theorem mul_left_strictMono (h0 : a ≠ 0) (hinf : a ≠ ∞) : StrictMono (a * ·) := by
  lift a to ℝ≥0 using hinf
  rw [coe_ne_zero] at h0
  intro x y h
  

Proof state:
case intro
α : Type u_1
β : Type u_2
b c d : ℝ≥0∞
r p q a : ℝ≥0
h0 : a ≠ 0
x y : ℝ≥0∞
h : x < y
⊢ (fun x => ↑a * x) x < (fun x => ↑a * x) y

Next tactic:
contrapose! h
theorem mul_left_strictMono (h0 : a ≠ 0) (hinf : a ≠ ∞) : StrictMono (a * ·) := by
  lift a to ℝ≥0 using hinf
  rw [coe_ne_zero] at h0
  intro x y h
  contrapose! h
  

Proof state:
case intro
α : Type u_1
β : Type u_2
b c d : ℝ≥0∞
r p q a : ℝ≥0
h0 : a ≠ 0
x y : ℝ≥0∞
h : ↑a * y ≤ ↑a * x
⊢ y ≤ x

Next tactic:
simpa only [← mul_assoc, ← coe_mul, inv_mul_cancel h0, coe_one, one_mul]
    using mul_le_mul_left' h (↑a⁻¹)
/-- An element `a` is `AddLECancellable` if `a + b ≤ a + c` implies `b ≤ c` for all `b` and `c`.
  This is true in `ℝ≥0∞` for all elements except `∞`. -/
theorem addLECancellable_iff_ne {a : ℝ≥0∞} : AddLECancellable a ↔ a ≠ ∞ := by
  

Proof state:
α : Type u_1
β : Type u_2
a✝ b c d : ℝ≥0∞
r p q : ℝ≥0
a : ℝ≥0∞
⊢ AddLECancellable a ↔ a ≠ ⊤

Next tactic:
constructor
/-- An element `a` is `AddLECancellable` if `a + b ≤ a + c` implies `b ≤ c` for all `b` and `c`.
  This is true in `ℝ≥0∞` for all elements except `∞`. -/
theorem addLECancellable_iff_ne {a : ℝ≥0∞} : AddLECancellable a ↔ a ≠ ∞ := by
  constructor
  · 

Proof state:
case mp
α : Type u_1
β : Type u_2
a✝ b c d : ℝ≥0∞
r p q : ℝ≥0
a : ℝ≥0∞
⊢ AddLECancellable a → a ≠ ⊤

Next tactic:
rintro h rfl
/-- An element `a` is `AddLECancellable` if `a + b ≤ a + c` implies `b ≤ c` for all `b` and `c`.
  This is true in `ℝ≥0∞` for all elements except `∞`. -/
theorem addLECancellable_iff_ne {a : ℝ≥0∞} : AddLECancellable a ↔ a ≠ ∞ := by
  constructor
  · rintro h rfl
    

Proof state:
case mp
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
h : AddLECancellable ⊤
⊢ False

Next tactic:
refine' zero_lt_one.not_le (h _)
/-- An element `a` is `AddLECancellable` if `a + b ≤ a + c` implies `b ≤ c` for all `b` and `c`.
  This is true in `ℝ≥0∞` for all elements except `∞`. -/
theorem addLECancellable_iff_ne {a : ℝ≥0∞} : AddLECancellable a ↔ a ≠ ∞ := by
  constructor
  · rintro h rfl
    refine' zero_lt_one.not_le (h _)
    

Proof state:
case mp
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
h : AddLECancellable ⊤
⊢ ⊤ + 1 ≤ ⊤ + 0

Next tactic:
simp
/-- An element `a` is `AddLECancellable` if `a + b ≤ a + c` implies `b ≤ c` for all `b` and `c`.
  This is true in `ℝ≥0∞` for all elements except `∞`. -/
theorem addLECancellable_iff_ne {a : ℝ≥0∞} : AddLECancellable a ↔ a ≠ ∞ := by
  constructor
  · rintro h rfl
    refine' zero_lt_one.not_le (h _)
    simp
  · 

Proof state:
case mpr
α : Type u_1
β : Type u_2
a✝ b c d : ℝ≥0∞
r p q : ℝ≥0
a : ℝ≥0∞
⊢ a ≠ ⊤ → AddLECancellable a

Next tactic:
rintro h b c hbc
/-- An element `a` is `AddLECancellable` if `a + b ≤ a + c` implies `b ≤ c` for all `b` and `c`.
  This is true in `ℝ≥0∞` for all elements except `∞`. -/
theorem addLECancellable_iff_ne {a : ℝ≥0∞} : AddLECancellable a ↔ a ≠ ∞ := by
  constructor
  · rintro h rfl
    refine' zero_lt_one.not_le (h _)
    simp
  · rintro h b c hbc
    

Proof state:
case mpr
α : Type u_1
β : Type u_2
a✝ b✝ c✝ d : ℝ≥0∞
r p q : ℝ≥0
a : ℝ≥0∞
h : a ≠ ⊤
b c : ℝ≥0∞
hbc : a + b ≤ a + c
⊢ b ≤ c

Next tactic:
apply ENNReal.le_of_add_le_add_left h hbc
@[simp, norm_cast]
theorem nat_cast_sub (m n : ℕ) : ↑(m - n) = (m - n : ℝ≥0∞) := by
  

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
m n : ℕ
⊢ ↑(m - n) = ↑m - ↑n

Next tactic:
rw [← coe_nat, Nat.cast_tsub, coe_sub, coe_nat, coe_nat]
protected theorem lt_add_of_sub_lt_left (h : a ≠ ∞ ∨ b ≠ ∞) : a - b < c → a < b + c := by
  

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
h : a ≠ ⊤ ∨ b ≠ ⊤
⊢ a - b < c → a < b + c

Next tactic:
obtain rfl | hb := eq_or_ne b ∞
protected theorem lt_add_of_sub_lt_left (h : a ≠ ∞ ∨ b ≠ ∞) : a - b < c → a < b + c := by
  obtain rfl | hb := eq_or_ne b ∞
  · 

Proof state:
case inl
α : Type u_1
β : Type u_2
a c d : ℝ≥0∞
r p q : ℝ≥0
h : a ≠ ⊤ ∨ ⊤ ≠ ⊤
⊢ a - ⊤ < c → a < ⊤ + c

Next tactic:
rw [top_add, lt_top_iff_ne_top]
protected theorem lt_add_of_sub_lt_left (h : a ≠ ∞ ∨ b ≠ ∞) : a - b < c → a < b + c := by
  obtain rfl | hb := eq_or_ne b ∞
  · rw [top_add, lt_top_iff_ne_top]
    

Proof state:
case inl
α : Type u_1
β : Type u_2
a c d : ℝ≥0∞
r p q : ℝ≥0
h : a ≠ ⊤ ∨ ⊤ ≠ ⊤
⊢ a - ⊤ < c → a ≠ ⊤

Next tactic:
exact fun _ => h.resolve_right (Classical.not_not.2 rfl)
protected theorem lt_add_of_sub_lt_left (h : a ≠ ∞ ∨ b ≠ ∞) : a - b < c → a < b + c := by
  obtain rfl | hb := eq_or_ne b ∞
  · rw [top_add, lt_top_iff_ne_top]
    exact fun _ => h.resolve_right (Classical.not_not.2 rfl)
  · 

Proof state:
case inr
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
h : a ≠ ⊤ ∨ b ≠ ⊤
hb : b ≠ ⊤
⊢ a - b < c → a < b + c

Next tactic:
exact (cancel_of_ne hb).lt_add_of_tsub_lt_left
theorem sub_mul (h : 0 < b → b < a → c ≠ ∞) : (a - b) * c = a * c - b * c := by
  

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
h : 0 < b → b < a → c ≠ ⊤
⊢ (a - b) * c = a * c - b * c

Next tactic:
rcases le_or_lt a b with hab | hab
theorem sub_mul (h : 0 < b → b < a → c ≠ ∞) : (a - b) * c = a * c - b * c := by
  rcases le_or_lt a b with hab | hab; · 

Proof state:
case inl
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
h : 0 < b → b < a → c ≠ ⊤
hab : a ≤ b
⊢ (a - b) * c = a * c - b * c

Next tactic:
simp [hab, mul_right_mono hab]
theorem sub_mul (h : 0 < b → b < a → c ≠ ∞) : (a - b) * c = a * c - b * c := by
  rcases le_or_lt a b with hab | hab; · simp [hab, mul_right_mono hab]
  

Proof state:
case inr
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
h : 0 < b → b < a → c ≠ ⊤
hab : b < a
⊢ (a - b) * c = a * c - b * c

Next tactic:
rcases eq_or_lt_of_le (zero_le b) with (rfl | hb)
theorem sub_mul (h : 0 < b → b < a → c ≠ ∞) : (a - b) * c = a * c - b * c := by
  rcases le_or_lt a b with hab | hab; · simp [hab, mul_right_mono hab]
  rcases eq_or_lt_of_le (zero_le b) with (rfl | hb); · 

Proof state:
case inr.inl
α : Type u_1
β : Type u_2
a c d : ℝ≥0∞
r p q : ℝ≥0
h : 0 < 0 → 0 < a → c ≠ ⊤
hab : 0 < a
⊢ (a - 0) * c = a * c - 0 * c

Next tactic:
simp
theorem sub_mul (h : 0 < b → b < a → c ≠ ∞) : (a - b) * c = a * c - b * c := by
  rcases le_or_lt a b with hab | hab; · simp [hab, mul_right_mono hab]
  rcases eq_or_lt_of_le (zero_le b) with (rfl | hb); · simp
  

Proof state:
case inr.inr
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
h : 0 < b → b < a → c ≠ ⊤
hab : b < a
hb : 0 < b
⊢ (a - b) * c = a * c - b * c

Next tactic:
exact (cancel_of_ne <| mul_ne_top hab.ne_top (h hb hab)).tsub_mul
theorem mul_sub (h : 0 < c → c < b → a ≠ ∞) : a * (b - c) = a * b - a * c := by
  

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
h : 0 < c → c < b → a ≠ ⊤
⊢ a * (b - c) = a * b - a * c

Next tactic:
simp only [mul_comm a]
theorem mul_sub (h : 0 < c → c < b → a ≠ ∞) : a * (b - c) = a * b - a * c := by
  simp only [mul_comm a]
  

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
h : 0 < c → c < b → a ≠ ⊤
⊢ (b - c) * a = b * a - c * a

Next tactic:
exact sub_mul h
/-- Seeing `ℝ≥0∞` as `ℝ≥0` does not change their sum, unless one of the `ℝ≥0∞` is
infinity -/
theorem toNNReal_sum {s : Finset α} {f : α → ℝ≥0∞} (hf : ∀ a ∈ s, f a ≠ ∞) :
    ENNReal.toNNReal (∑ a in s, f a) = ∑ a in s, ENNReal.toNNReal (f a) := by
  

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
s : Finset α
f : α → ℝ≥0∞
hf : ∀ a ∈ s, f a ≠ ⊤
⊢ ENNReal.toNNReal (∑ a in s, f a) = ∑ a in s, ENNReal.toNNReal (f a)

Next tactic:
rw [← coe_eq_coe, coe_toNNReal, coe_finset_sum, sum_congr rfl]
/-- Seeing `ℝ≥0∞` as `ℝ≥0` does not change their sum, unless one of the `ℝ≥0∞` is
infinity -/
theorem toNNReal_sum {s : Finset α} {f : α → ℝ≥0∞} (hf : ∀ a ∈ s, f a ≠ ∞) :
    ENNReal.toNNReal (∑ a in s, f a) = ∑ a in s, ENNReal.toNNReal (f a) := by
  rw [← coe_eq_coe, coe_toNNReal, coe_finset_sum, sum_congr rfl]
  · 

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
s : Finset α
f : α → ℝ≥0∞
hf : ∀ a ∈ s, f a ≠ ⊤
⊢ ∀ x ∈ s, f x = ↑(ENNReal.toNNReal (f x))

Next tactic:
intro x hx
/-- Seeing `ℝ≥0∞` as `ℝ≥0` does not change their sum, unless one of the `ℝ≥0∞` is
infinity -/
theorem toNNReal_sum {s : Finset α} {f : α → ℝ≥0∞} (hf : ∀ a ∈ s, f a ≠ ∞) :
    ENNReal.toNNReal (∑ a in s, f a) = ∑ a in s, ENNReal.toNNReal (f a) := by
  rw [← coe_eq_coe, coe_toNNReal, coe_finset_sum, sum_congr rfl]
  · intro x hx
    

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
s : Finset α
f : α → ℝ≥0∞
hf : ∀ a ∈ s, f a ≠ ⊤
x : α
hx : x ∈ s
⊢ f x = ↑(ENNReal.toNNReal (f x))

Next tactic:
exact (coe_toNNReal (hf x hx)).symm
/-- Seeing `ℝ≥0∞` as `ℝ≥0` does not change their sum, unless one of the `ℝ≥0∞` is
infinity -/
theorem toNNReal_sum {s : Finset α} {f : α → ℝ≥0∞} (hf : ∀ a ∈ s, f a ≠ ∞) :
    ENNReal.toNNReal (∑ a in s, f a) = ∑ a in s, ENNReal.toNNReal (f a) := by
  rw [← coe_eq_coe, coe_toNNReal, coe_finset_sum, sum_congr rfl]
  · intro x hx
    exact (coe_toNNReal (hf x hx)).symm
  · 

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
s : Finset α
f : α → ℝ≥0∞
hf : ∀ a ∈ s, f a ≠ ⊤
⊢ ∑ a in s, f a ≠ ⊤

Next tactic:
exact (sum_lt_top hf).ne
/-- seeing `ℝ≥0∞` as `Real` does not change their sum, unless one of the `ℝ≥0∞` is infinity -/
theorem toReal_sum {s : Finset α} {f : α → ℝ≥0∞} (hf : ∀ a ∈ s, f a ≠ ∞) :
    ENNReal.toReal (∑ a in s, f a) = ∑ a in s, ENNReal.toReal (f a) := by
  

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
s : Finset α
f : α → ℝ≥0∞
hf : ∀ a ∈ s, f a ≠ ⊤
⊢ ENNReal.toReal (∑ a in s, f a) = ∑ a in s, ENNReal.toReal (f a)

Next tactic:
rw [ENNReal.toReal, toNNReal_sum hf, NNReal.coe_sum]
/-- seeing `ℝ≥0∞` as `Real` does not change their sum, unless one of the `ℝ≥0∞` is infinity -/
theorem toReal_sum {s : Finset α} {f : α → ℝ≥0∞} (hf : ∀ a ∈ s, f a ≠ ∞) :
    ENNReal.toReal (∑ a in s, f a) = ∑ a in s, ENNReal.toReal (f a) := by
  rw [ENNReal.toReal, toNNReal_sum hf, NNReal.coe_sum]
  

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
s : Finset α
f : α → ℝ≥0∞
hf : ∀ a ∈ s, f a ≠ ⊤
⊢ ∑ a in s, ↑(ENNReal.toNNReal (f a)) = ∑ a in s, ENNReal.toReal (f a)

Next tactic:
rfl
theorem ofReal_sum_of_nonneg {s : Finset α} {f : α → ℝ} (hf : ∀ i, i ∈ s → 0 ≤ f i) :
    ENNReal.ofReal (∑ i in s, f i) = ∑ i in s, ENNReal.ofReal (f i) := by
  

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
s : Finset α
f : α → ℝ
hf : ∀ i ∈ s, 0 ≤ f i
⊢ ENNReal.ofReal (∑ i in s, f i) = ∑ i in s, ENNReal.ofReal (f i)

Next tactic:
simp_rw [ENNReal.ofReal, ← coe_finset_sum, coe_eq_coe]
theorem ofReal_sum_of_nonneg {s : Finset α} {f : α → ℝ} (hf : ∀ i, i ∈ s → 0 ≤ f i) :
    ENNReal.ofReal (∑ i in s, f i) = ∑ i in s, ENNReal.ofReal (f i) := by
  simp_rw [ENNReal.ofReal, ← coe_finset_sum, coe_eq_coe]
  

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
s : Finset α
f : α → ℝ
hf : ∀ i ∈ s, 0 ≤ f i
⊢ Real.toNNReal (∑ i in s, f i) = ∑ a in s, Real.toNNReal (f a)

Next tactic:
exact Real.toNNReal_sum_of_nonneg hf
theorem sum_lt_sum_of_nonempty {s : Finset α} (hs : s.Nonempty) {f g : α → ℝ≥0∞}
    (Hlt : ∀ i ∈ s, f i < g i) : ∑ i in s, f i < ∑ i in s, g i := by
  

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
s : Finset α
hs : Finset.Nonempty s
f g : α → ℝ≥0∞
Hlt : ∀ i ∈ s, f i < g i
⊢ ∑ i in s, f i < ∑ i in s, g i

Next tactic:
induction' hs using Finset.Nonempty.cons_induction with a a s as _ IH
theorem sum_lt_sum_of_nonempty {s : Finset α} (hs : s.Nonempty) {f g : α → ℝ≥0∞}
    (Hlt : ∀ i ∈ s, f i < g i) : ∑ i in s, f i < ∑ i in s, g i := by
  induction' hs using Finset.Nonempty.cons_induction with a a s as _ IH
  · 

Proof state:
case h₀
α : Type u_1
β : Type u_2
a✝ b c d : ℝ≥0∞
r p q : ℝ≥0
s : Finset α
f g : α → ℝ≥0∞
a : α
Hlt : ∀ i ∈ {a}, f i < g i
⊢ ∑ i in {a}, f i < ∑ i in {a}, g i

Next tactic:
simp [Hlt _ (Finset.mem_singleton_self _)]
theorem sum_lt_sum_of_nonempty {s : Finset α} (hs : s.Nonempty) {f g : α → ℝ≥0∞}
    (Hlt : ∀ i ∈ s, f i < g i) : ∑ i in s, f i < ∑ i in s, g i := by
  induction' hs using Finset.Nonempty.cons_induction with a a s as _ IH
  · simp [Hlt _ (Finset.mem_singleton_self _)]
  · 

Proof state:
case h₁
α : Type u_1
β : Type u_2
a✝ b c d : ℝ≥0∞
r p q : ℝ≥0
s✝ : Finset α
f g : α → ℝ≥0∞
a : α
s : Finset α
as : a ∉ s
hs✝ : Finset.Nonempty s
IH : (∀ i ∈ s, f i < g i) → ∑ i in s, f i < ∑ i in s, g i
Hlt : ∀ i ∈ cons a s as, f i < g i
⊢ ∑ i in cons a s as, f i < ∑ i in cons a s as, g i

Next tactic:
simp only [as, Finset.sum_cons, not_false_iff]
theorem sum_lt_sum_of_nonempty {s : Finset α} (hs : s.Nonempty) {f g : α → ℝ≥0∞}
    (Hlt : ∀ i ∈ s, f i < g i) : ∑ i in s, f i < ∑ i in s, g i := by
  induction' hs using Finset.Nonempty.cons_induction with a a s as _ IH
  · simp [Hlt _ (Finset.mem_singleton_self _)]
  · simp only [as, Finset.sum_cons, not_false_iff]
    

Proof state:
case h₁
α : Type u_1
β : Type u_2
a✝ b c d : ℝ≥0∞
r p q : ℝ≥0
s✝ : Finset α
f g : α → ℝ≥0∞
a : α
s : Finset α
as : a ∉ s
hs✝ : Finset.Nonempty s
IH : (∀ i ∈ s, f i < g i) → ∑ i in s, f i < ∑ i in s, g i
Hlt : ∀ i ∈ cons a s as, f i < g i
⊢ f a + ∑ i in s, f i < g a + ∑ i in s, g i

Next tactic:
exact
      ENNReal.add_lt_add (Hlt _ (Finset.mem_cons_self _ _))
        (IH fun i hi => Hlt _ (Finset.mem_cons.2 <| Or.inr hi))
theorem exists_le_of_sum_le {s : Finset α} (hs : s.Nonempty) {f g : α → ℝ≥0∞}
    (Hle : ∑ i in s, f i ≤ ∑ i in s, g i) : ∃ i ∈ s, f i ≤ g i := by
  

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
s : Finset α
hs : Finset.Nonempty s
f g : α → ℝ≥0∞
Hle : ∑ i in s, f i ≤ ∑ i in s, g i
⊢ ∃ i ∈ s, f i ≤ g i

Next tactic:
contrapose! Hle
theorem exists_le_of_sum_le {s : Finset α} (hs : s.Nonempty) {f g : α → ℝ≥0∞}
    (Hle : ∑ i in s, f i ≤ ∑ i in s, g i) : ∃ i ∈ s, f i ≤ g i := by
  contrapose! Hle
  

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
s : Finset α
hs : Finset.Nonempty s
f g : α → ℝ≥0∞
Hle : ∀ i ∈ s, g i < f i
⊢ ∑ i in s, g i < ∑ i in s, f i

Next tactic:
apply ENNReal.sum_lt_sum_of_nonempty hs Hle
protected theorem div_eq_inv_mul : a / b = b⁻¹ * a := by 

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
⊢ a / b = b⁻¹ * a

Next tactic:
rw [div_eq_mul_inv, mul_comm]
@[simp] theorem inv_zero : (0 : ℝ≥0∞)⁻¹ = ∞ :=
  show sInf { b : ℝ≥0∞ | 1 ≤ 0 * b } = ∞ by 

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
⊢ sInf {b | 1 ≤ 0 * b} = ⊤

Next tactic:
simp
@[simp] theorem inv_top : ∞⁻¹ = 0 :=
  bot_unique <| le_of_forall_le_of_dense fun a (h : 0 < a) => sInf_le <| by 

Proof state:
α : Type u_1
β : Type u_2
a✝ b c d : ℝ≥0∞
r p q : ℝ≥0
a : ℝ≥0∞
h : 0 < a
⊢ a ∈ {b | 1 ≤ ⊤ * b}

Next tactic:
simp [*, h.ne', top_mul]