l3lab/ntp-mathlib huggingface dataset:
protected theorem trichotomy₂ {p q : ℝ≥0∞} (hpq : p ≤ q) :
    p = 0 ∧ q = 0 ∨
      p = 0 ∧ q = ∞ ∨
        p = 0 ∧ 0 < q.toReal ∨
          p = ∞ ∧ q = ∞ ∨
            0 < p.toReal ∧ q = ∞ ∨ 0 < p.toReal ∧ 0 < q.toReal ∧ p.toReal ≤ q.toReal := by
  rcases eq_or_lt_of_le (bot_le : 0 ≤ p) with ((rfl : 0 = p) | (hp : 0 < p))
  · simpa using q.trichotomy
  rcases eq_or_lt_of_le (le_top : q ≤ ∞) with (rfl | hq)
  · simpa using p.trichotomy
  repeat' right
  have hq' : 0 < q := lt_of_lt_of_le hp hpq
  have hp' : p < ∞ := lt_of_le_of_lt hpq hq
  

Proof state:
case inr.inr.h.h.h.h.h
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p✝ q✝ : ℝ≥0
p q : ℝ≥0∞
hpq : p ≤ q
hp : 0 < p
hq : q < ⊤
hq' : 0 < q
hp' : p < ⊤
⊢ 0 < ENNReal.toReal p ∧ 0 < ENNReal.toReal q ∧ ENNReal.toReal p ≤ ENNReal.toReal q

Next tactic:
simp [ENNReal.toReal_le_toReal hp'.ne hq.ne, ENNReal.toReal_pos_iff, hpq, hp, hp', hq', hq]
protected theorem dichotomy (p : ℝ≥0∞) [Fact (1 ≤ p)] : p = ∞ ∨ 1 ≤ p.toReal :=
  haveI : p = ⊤ ∨ 0 < p.toReal ∧ 1 ≤ p.toReal := by
    

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p✝ q : ℝ≥0
p : ℝ≥0∞
inst✝ : Fact (1 ≤ p)
⊢ p = ⊤ ∨ 0 < ENNReal.toReal p ∧ 1 ≤ ENNReal.toReal p

Next tactic:
simpa using ENNReal.trichotomy₂ (Fact.out : 1 ≤ p)
theorem toNNReal_inv (a : ℝ≥0∞) : a⁻¹.toNNReal = a.toNNReal⁻¹ := by
  

Proof state:
α : Type u_1
β : Type u_2
a✝ b c d : ℝ≥0∞
r p q : ℝ≥0
a : ℝ≥0∞
⊢ ENNReal.toNNReal a⁻¹ = (ENNReal.toNNReal a)⁻¹

Next tactic:
induction' a using recTopCoe with a
theorem toNNReal_inv (a : ℝ≥0∞) : a⁻¹.toNNReal = a.toNNReal⁻¹ := by
  induction' a using recTopCoe with a; · 

Proof state:
case top
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
⊢ ENNReal.toNNReal ⊤⁻¹ = (ENNReal.toNNReal ⊤)⁻¹

Next tactic:
simp
theorem toNNReal_inv (a : ℝ≥0∞) : a⁻¹.toNNReal = a.toNNReal⁻¹ := by
  induction' a using recTopCoe with a; · simp
  

Proof state:
case coe
α : Type u_1
β : Type u_2
a✝ b c d : ℝ≥0∞
r p q a : ℝ≥0
⊢ ENNReal.toNNReal (↑a)⁻¹ = (ENNReal.toNNReal ↑a)⁻¹

Next tactic:
rcases eq_or_ne a 0 with (rfl | ha)
theorem toNNReal_inv (a : ℝ≥0∞) : a⁻¹.toNNReal = a.toNNReal⁻¹ := by
  induction' a using recTopCoe with a; · simp
  rcases eq_or_ne a 0 with (rfl | ha); · 

Proof state:
case coe.inl
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
⊢ ENNReal.toNNReal (↑0)⁻¹ = (ENNReal.toNNReal ↑0)⁻¹

Next tactic:
simp
theorem toNNReal_inv (a : ℝ≥0∞) : a⁻¹.toNNReal = a.toNNReal⁻¹ := by
  induction' a using recTopCoe with a; · simp
  rcases eq_or_ne a 0 with (rfl | ha); · simp
  

Proof state:
case coe.inr
α : Type u_1
β : Type u_2
a✝ b c d : ℝ≥0∞
r p q a : ℝ≥0
ha : a ≠ 0
⊢ ENNReal.toNNReal (↑a)⁻¹ = (ENNReal.toNNReal ↑a)⁻¹

Next tactic:
rw [← coe_inv ha, toNNReal_coe, toNNReal_coe]
theorem toNNReal_div (a b : ℝ≥0∞) : (a / b).toNNReal = a.toNNReal / b.toNNReal := by
  

Proof state:
α : Type u_1
β : Type u_2
a✝ b✝ c d : ℝ≥0∞
r p q : ℝ≥0
a b : ℝ≥0∞
⊢ ENNReal.toNNReal (a / b) = ENNReal.toNNReal a / ENNReal.toNNReal b

Next tactic:
rw [div_eq_mul_inv, toNNReal_mul, toNNReal_inv, div_eq_mul_inv]
theorem toReal_inv (a : ℝ≥0∞) : a⁻¹.toReal = a.toReal⁻¹ := by
  

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

Next tactic:
simp only [ENNReal.toReal, toNNReal_inv, NNReal.coe_inv]
theorem toReal_div (a b : ℝ≥0∞) : (a / b).toReal = a.toReal / b.toReal := by
  

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

Next tactic:
rw [div_eq_mul_inv, toReal_mul, toReal_inv, div_eq_mul_inv]
theorem ofReal_prod_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_prod, coe_eq_coe]
theorem ofReal_prod_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_prod, 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_prod_of_nonneg hf
theorem toNNReal_iInf (hf : ∀ i, f i ≠ ∞) : (iInf f).toNNReal = ⨅ i, (f i).toNNReal := by
  

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
ι : Sort u_3
f g : ι → ℝ≥0∞
hf : ∀ (i : ι), f i ≠ ⊤
⊢ ENNReal.toNNReal (iInf f) = ⨅ i, ENNReal.toNNReal (f i)

Next tactic:
cases isEmpty_or_nonempty ι
theorem toNNReal_iInf (hf : ∀ i, f i ≠ ∞) : (iInf f).toNNReal = ⨅ i, (f i).toNNReal := by
  cases isEmpty_or_nonempty ι
  · 

Proof state:
case inl
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
ι : Sort u_3
f g : ι → ℝ≥0∞
hf : ∀ (i : ι), f i ≠ ⊤
h✝ : IsEmpty ι
⊢ ENNReal.toNNReal (iInf f) = ⨅ i, ENNReal.toNNReal (f i)

Next tactic:
rw [iInf_of_empty, top_toNNReal, NNReal.iInf_empty]
theorem toNNReal_iInf (hf : ∀ i, f i ≠ ∞) : (iInf f).toNNReal = ⨅ i, (f i).toNNReal := by
  cases isEmpty_or_nonempty ι
  · rw [iInf_of_empty, top_toNNReal, NNReal.iInf_empty]
  · 

Proof state:
case inr
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
ι : Sort u_3
f g : ι → ℝ≥0∞
hf : ∀ (i : ι), f i ≠ ⊤
h✝ : Nonempty ι
⊢ ENNReal.toNNReal (iInf f) = ⨅ i, ENNReal.toNNReal (f i)

Next tactic:
lift f to ι → ℝ≥0 using hf
theorem toNNReal_iInf (hf : ∀ i, f i ≠ ∞) : (iInf f).toNNReal = ⨅ i, (f i).toNNReal := by
  cases isEmpty_or_nonempty ι
  · rw [iInf_of_empty, top_toNNReal, NNReal.iInf_empty]
  · lift f to ι → ℝ≥0 using hf
    

Proof state:
case inr.intro
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
ι : Sort u_3
g : ι → ℝ≥0∞
h✝ : Nonempty ι
f : ι → ℝ≥0
⊢ ENNReal.toNNReal (⨅ i, ↑(f i)) = ⨅ i, ENNReal.toNNReal ((fun i => ↑(f i)) i)

Next tactic:
simp_rw [← coe_iInf, toNNReal_coe]
theorem toNNReal_sInf (s : Set ℝ≥0∞) (hs : ∀ r ∈ s, r ≠ ∞) :
    (sInf s).toNNReal = sInf (ENNReal.toNNReal '' s) := by
  

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
ι : Sort u_3
f g : ι → ℝ≥0∞
s : Set ℝ≥0∞
hs : ∀ r ∈ s, r ≠ ⊤
⊢ ENNReal.toNNReal (sInf s) = sInf (ENNReal.toNNReal '' s)

Next tactic:
have hf : ∀ i, ((↑) : s → ℝ≥0∞) i ≠ ∞ := fun ⟨r, rs⟩ => hs r rs
theorem toNNReal_sInf (s : Set ℝ≥0∞) (hs : ∀ r ∈ s, r ≠ ∞) :
    (sInf s).toNNReal = sInf (ENNReal.toNNReal '' s) := by
  have hf : ∀ i, ((↑) : s → ℝ≥0∞) i ≠ ∞ := fun ⟨r, rs⟩ => hs r rs
  -- porting note: `← sInf_image'` had to be replaced by `← image_eq_range` as the lemmas are used
  -- in a different order.
  

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
ι : Sort u_3
f g : ι → ℝ≥0∞
s : Set ℝ≥0∞
hs : ∀ r ∈ s, r ≠ ⊤
hf : ∀ (i : { x // x ∈ s }), ↑i ≠ ⊤
⊢ ENNReal.toNNReal (sInf s) = sInf (ENNReal.toNNReal '' s)

Next tactic:
simpa only [← sInf_range, ← image_eq_range, Subtype.range_coe_subtype] using (toNNReal_iInf hf)
theorem toNNReal_iSup (hf : ∀ i, f i ≠ ∞) : (iSup f).toNNReal = ⨆ i, (f i).toNNReal := by
  

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
ι : Sort u_3
f g : ι → ℝ≥0∞
hf : ∀ (i : ι), f i ≠ ⊤
⊢ ENNReal.toNNReal (iSup f) = ⨆ i, ENNReal.toNNReal (f i)

Next tactic:
lift f to ι → ℝ≥0 using hf
theorem toNNReal_iSup (hf : ∀ i, f i ≠ ∞) : (iSup f).toNNReal = ⨆ i, (f i).toNNReal := by
  lift f to ι → ℝ≥0 using hf
  

Proof state:
case intro
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
ι : Sort u_3
g : ι → ℝ≥0∞
f : ι → ℝ≥0
⊢ ENNReal.toNNReal (⨆ i, ↑(f i)) = ⨆ i, ENNReal.toNNReal ((fun i => ↑(f i)) i)

Next tactic:
simp_rw [toNNReal_coe]
theorem toNNReal_iSup (hf : ∀ i, f i ≠ ∞) : (iSup f).toNNReal = ⨆ i, (f i).toNNReal := by
  lift f to ι → ℝ≥0 using hf
  simp_rw [toNNReal_coe]
  

Proof state:
case intro
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
ι : Sort u_3
g : ι → ℝ≥0∞
f : ι → ℝ≥0
⊢ ENNReal.toNNReal (⨆ i, ↑(f i)) = ⨆ i, f i

Next tactic:
by_cases h : BddAbove (range f)
theorem toNNReal_iSup (hf : ∀ i, f i ≠ ∞) : (iSup f).toNNReal = ⨆ i, (f i).toNNReal := by
  lift f to ι → ℝ≥0 using hf
  simp_rw [toNNReal_coe]
  by_cases h : BddAbove (range f)
  · 

Proof state:
case pos
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
ι : Sort u_3
g : ι → ℝ≥0∞
f : ι → ℝ≥0
h : BddAbove (range f)
⊢ ENNReal.toNNReal (⨆ i, ↑(f i)) = ⨆ i, f i

Next tactic:
rw [← coe_iSup h, toNNReal_coe]
theorem toNNReal_iSup (hf : ∀ i, f i ≠ ∞) : (iSup f).toNNReal = ⨆ i, (f i).toNNReal := by
  lift f to ι → ℝ≥0 using hf
  simp_rw [toNNReal_coe]
  by_cases h : BddAbove (range f)
  · rw [← coe_iSup h, toNNReal_coe]
  · 

Proof state:
case neg
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
ι : Sort u_3
g : ι → ℝ≥0∞
f : ι → ℝ≥0
h : ¬BddAbove (range f)
⊢ ENNReal.toNNReal (⨆ i, ↑(f i)) = ⨆ i, f i

Next tactic:
rw [NNReal.iSup_of_not_bddAbove h, iSup_coe_eq_top.2 h, top_toNNReal]
theorem toNNReal_sSup (s : Set ℝ≥0∞) (hs : ∀ r ∈ s, r ≠ ∞) :
    (sSup s).toNNReal = sSup (ENNReal.toNNReal '' s) := by
  

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
ι : Sort u_3
f g : ι → ℝ≥0∞
s : Set ℝ≥0∞
hs : ∀ r ∈ s, r ≠ ⊤
⊢ ENNReal.toNNReal (sSup s) = sSup (ENNReal.toNNReal '' s)

Next tactic:
have hf : ∀ i, ((↑) : s → ℝ≥0∞) i ≠ ∞ := fun ⟨r, rs⟩ => hs r rs
theorem toNNReal_sSup (s : Set ℝ≥0∞) (hs : ∀ r ∈ s, r ≠ ∞) :
    (sSup s).toNNReal = sSup (ENNReal.toNNReal '' s) := by
  have hf : ∀ i, ((↑) : s → ℝ≥0∞) i ≠ ∞ := fun ⟨r, rs⟩ => hs r rs
  -- porting note: `← sSup_image'` had to be replaced by `← image_eq_range` as the lemmas are used
  -- in a different order.
  

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
ι : Sort u_3
f g : ι → ℝ≥0∞
s : Set ℝ≥0∞
hs : ∀ r ∈ s, r ≠ ⊤
hf : ∀ (i : { x // x ∈ s }), ↑i ≠ ⊤
⊢ ENNReal.toNNReal (sSup s) = sSup (ENNReal.toNNReal '' s)

Next tactic:
simpa only [← sSup_range, ← image_eq_range, Subtype.range_coe_subtype] using (toNNReal_iSup hf)
theorem toReal_iInf (hf : ∀ i, f i ≠ ∞) : (iInf f).toReal = ⨅ i, (f i).toReal := by
  

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
ι : Sort u_3
f g : ι → ℝ≥0∞
hf : ∀ (i : ι), f i ≠ ⊤
⊢ ENNReal.toReal (iInf f) = ⨅ i, ENNReal.toReal (f i)

Next tactic:
simp only [ENNReal.toReal, toNNReal_iInf hf, NNReal.coe_iInf]
theorem toReal_sInf (s : Set ℝ≥0∞) (hf : ∀ r ∈ s, r ≠ ∞) :
    (sInf s).toReal = sInf (ENNReal.toReal '' s) := by
  

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
ι : Sort u_3
f g : ι → ℝ≥0∞
s : Set ℝ≥0∞
hf : ∀ r ∈ s, r ≠ ⊤
⊢ ENNReal.toReal (sInf s) = sInf (ENNReal.toReal '' s)

Next tactic:
simp only [ENNReal.toReal, toNNReal_sInf s hf, NNReal.coe_sInf, Set.image_image]
theorem toReal_iSup (hf : ∀ i, f i ≠ ∞) : (iSup f).toReal = ⨆ i, (f i).toReal := by
  

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
ι : Sort u_3
f g : ι → ℝ≥0∞
hf : ∀ (i : ι), f i ≠ ⊤
⊢ ENNReal.toReal (iSup f) = ⨆ i, ENNReal.toReal (f i)

Next tactic:
simp only [ENNReal.toReal, toNNReal_iSup hf, NNReal.coe_iSup]
theorem toReal_sSup (s : Set ℝ≥0∞) (hf : ∀ r ∈ s, r ≠ ∞) :
    (sSup s).toReal = sSup (ENNReal.toReal '' s) := by
  

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
ι : Sort u_3
f g : ι → ℝ≥0∞
s : Set ℝ≥0∞
hf : ∀ r ∈ s, r ≠ ⊤
⊢ ENNReal.toReal (sSup s) = sSup (ENNReal.toReal '' s)

Next tactic:
simp only [ENNReal.toReal, toNNReal_sSup s hf, NNReal.coe_sSup, Set.image_image]
theorem sub_iInf : (a - ⨅ i, f i) = ⨆ i, a - f i := by
  

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
ι : Sort u_3
f g : ι → ℝ≥0∞
⊢ a - ⨅ i, f i = ⨆ i, a - f i

Next tactic:
refine' eq_of_forall_ge_iff fun c => _
theorem sub_iInf : (a - ⨅ i, f i) = ⨆ i, a - f i := by
  refine' eq_of_forall_ge_iff fun c => _
  

Proof state:
α : Type u_1
β : Type u_2
a b c✝ d : ℝ≥0∞
r p q : ℝ≥0
ι : Sort u_3
f g : ι → ℝ≥0∞
c : ℝ≥0∞
⊢ a - ⨅ i, f i ≤ c ↔ ⨆ i, a - f i ≤ c

Next tactic:
rw [tsub_le_iff_right, add_comm, iInf_add]
theorem sub_iInf : (a - ⨅ i, f i) = ⨆ i, a - f i := by
  refine' eq_of_forall_ge_iff fun c => _
  rw [tsub_le_iff_right, add_comm, iInf_add]
  

Proof state:
α : Type u_1
β : Type u_2
a b c✝ d : ℝ≥0∞
r p q : ℝ≥0
ι : Sort u_3
f g : ι → ℝ≥0∞
c : ℝ≥0∞
⊢ a ≤ ⨅ i, f i + c ↔ ⨆ i, a - f i ≤ c

Next tactic:
simp [tsub_le_iff_right, sub_eq_add_neg, add_comm]
theorem sInf_add {s : Set ℝ≥0∞} : sInf s + a = ⨅ b ∈ s, b + a := by 

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
ι : Sort u_3
f g : ι → ℝ≥0∞
s : Set ℝ≥0∞
⊢ sInf s + a = ⨅ b ∈ s, b + a

Next tactic:
simp [sInf_eq_iInf, iInf_add]
theorem add_iInf {a : ℝ≥0∞} : a + iInf f = ⨅ b, a + f b := by
  

Proof state:
α : Type u_1
β : Type u_2
a✝ b c d : ℝ≥0∞
r p q : ℝ≥0
ι : Sort u_3
f g : ι → ℝ≥0∞
a : ℝ≥0∞
⊢ a + iInf f = ⨅ b, a + f b

Next tactic:
rw [add_comm, iInf_add]
theorem add_iInf {a : ℝ≥0∞} : a + iInf f = ⨅ b, a + f b := by
  rw [add_comm, iInf_add]; 

Proof state:
α : Type u_1
β : Type u_2
a✝ b c d : ℝ≥0∞
r p q : ℝ≥0
ι : Sort u_3
f g : ι → ℝ≥0∞
a : ℝ≥0∞
⊢ ⨅ i, f i + a = ⨅ b, a + f b

Next tactic:
simp [add_comm]
theorem iInf_add_iInf (h : ∀ i j, ∃ k, f k + g k ≤ f i + g j) : iInf f + iInf g = ⨅ a, f a + g a :=
  suffices ⨅ a, f a + g a ≤ iInf f + iInf g from
    le_antisymm (le_iInf fun a => add_le_add (iInf_le _ _) (iInf_le _ _)) this
  calc
    ⨅ a, f a + g a ≤ ⨅ (a) (a'), f a + g a' :=
      le_iInf₂ fun a a' => let ⟨k, h⟩ := h a a'; iInf_le_of_le k h
    _ = iInf f + iInf g := by 

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
ι : Sort u_3
f g : ι → ℝ≥0∞
h : ∀ (i j : ι), ∃ k, f k + g k ≤ f i + g j
⊢ ⨅ a, ⨅ a', f a + g a' = iInf f + iInf g

Next tactic:
simp_rw [iInf_add, add_iInf]
theorem iInf_sum {f : ι → α → ℝ≥0∞} {s : Finset α} [Nonempty ι]
    (h : ∀ (t : Finset α) (i j : ι), ∃ k, ∀ a ∈ t, f k a ≤ f i a ∧ f k a ≤ f j a) :
    ⨅ i, ∑ a in s, f i a = ∑ a in s, ⨅ i, f i a := by
  

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
ι : Sort u_3
f✝ g : ι → ℝ≥0∞
f : ι → α → ℝ≥0∞
s : Finset α
inst✝ : Nonempty ι
h : ∀ (t : Finset α) (i j : ι), ∃ k, ∀ a ∈ t, f k a ≤ f i a ∧ f k a ≤ f j a
⊢ ⨅ i, ∑ a in s, f i a = ∑ a in s, ⨅ i, f i a

Next tactic:
induction' s using Finset.cons_induction_on with a s ha ih
theorem iInf_sum {f : ι → α → ℝ≥0∞} {s : Finset α} [Nonempty ι]
    (h : ∀ (t : Finset α) (i j : ι), ∃ k, ∀ a ∈ t, f k a ≤ f i a ∧ f k a ≤ f j a) :
    ⨅ i, ∑ a in s, f i a = ∑ a in s, ⨅ i, f i a := by
  induction' s using Finset.cons_induction_on with a s ha ih
  · 

Proof state:
case h₁
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
ι : Sort u_3
f✝ g : ι → ℝ≥0∞
f : ι → α → ℝ≥0∞
inst✝ : Nonempty ι
h : ∀ (t : Finset α) (i j : ι), ∃ k, ∀ a ∈ t, f k a ≤ f i a ∧ f k a ≤ f j a
⊢ ⨅ i, ∑ a in ∅, f i a = ∑ a in ∅, ⨅ i, f i a

Next tactic:
simp only [Finset.sum_empty, ciInf_const]
theorem iInf_sum {f : ι → α → ℝ≥0∞} {s : Finset α} [Nonempty ι]
    (h : ∀ (t : Finset α) (i j : ι), ∃ k, ∀ a ∈ t, f k a ≤ f i a ∧ f k a ≤ f j a) :
    ⨅ i, ∑ a in s, f i a = ∑ a in s, ⨅ i, f i a := by
  induction' s using Finset.cons_induction_on with a s ha ih
  · simp only [Finset.sum_empty, ciInf_const]
  · 

Proof state:
case h₂
α : Type u_1
β : Type u_2
a✝ b c d : ℝ≥0∞
r p q : ℝ≥0
ι : Sort u_3
f✝ g : ι → ℝ≥0∞
f : ι → α → ℝ≥0∞
inst✝ : Nonempty ι
h : ∀ (t : Finset α) (i j : ι), ∃ k, ∀ a ∈ t, f k a ≤ f i a ∧ f k a ≤ f j a
a : α
s : Finset α
ha : a ∉ s
ih : ⨅ i, ∑ a in s, f i a = ∑ a in s, ⨅ i, f i a
⊢ ⨅ i, ∑ a in Finset.cons a s ha, f i a = ∑ a in Finset.cons a s ha, ⨅ i, f i a

Next tactic:
simp only [Finset.sum_cons, ← ih]
theorem iInf_sum {f : ι → α → ℝ≥0∞} {s : Finset α} [Nonempty ι]
    (h : ∀ (t : Finset α) (i j : ι), ∃ k, ∀ a ∈ t, f k a ≤ f i a ∧ f k a ≤ f j a) :
    ⨅ i, ∑ a in s, f i a = ∑ a in s, ⨅ i, f i a := by
  induction' s using Finset.cons_induction_on with a s ha ih
  · simp only [Finset.sum_empty, ciInf_const]
  · simp only [Finset.sum_cons, ← ih]
    

Proof state:
case h₂
α : Type u_1
β : Type u_2
a✝ b c d : ℝ≥0∞
r p q : ℝ≥0
ι : Sort u_3
f✝ g : ι → ℝ≥0∞
f : ι → α → ℝ≥0∞
inst✝ : Nonempty ι
h : ∀ (t : Finset α) (i j : ι), ∃ k, ∀ a ∈ t, f k a ≤ f i a ∧ f k a ≤ f j a
a : α
s : Finset α
ha : a ∉ s
ih : ⨅ i, ∑ a in s, f i a = ∑ a in s, ⨅ i, f i a
⊢ ⨅ i, f i a + ∑ a in s, f i a = (⨅ i, f i a) + ⨅ i, ∑ a in s, f i a

Next tactic:
refine (iInf_add_iInf fun i j => ?_).symm
theorem iInf_sum {f : ι → α → ℝ≥0∞} {s : Finset α} [Nonempty ι]
    (h : ∀ (t : Finset α) (i j : ι), ∃ k, ∀ a ∈ t, f k a ≤ f i a ∧ f k a ≤ f j a) :
    ⨅ i, ∑ a in s, f i a = ∑ a in s, ⨅ i, f i a := by
  induction' s using Finset.cons_induction_on with a s ha ih
  · simp only [Finset.sum_empty, ciInf_const]
  · simp only [Finset.sum_cons, ← ih]
    refine (iInf_add_iInf fun i j => ?_).symm
    

Proof state:
case h₂
α : Type u_1
β : Type u_2
a✝ b c d : ℝ≥0∞
r p q : ℝ≥0
ι : Sort u_3
f✝ g : ι → ℝ≥0∞
f : ι → α → ℝ≥0∞
inst✝ : Nonempty ι
h : ∀ (t : Finset α) (i j : ι), ∃ k, ∀ a ∈ t, f k a ≤ f i a ∧ f k a ≤ f j a
a : α
s : Finset α
ha : a ∉ s
ih : ⨅ i, ∑ a in s, f i a = ∑ a in s, ⨅ i, f i a
i j : ι
⊢ ∃ k, f k a + ∑ a in s, f k a ≤ f i a + ∑ a in s, f j a

Next tactic:
refine (h (Finset.cons a s ha) i j).imp fun k hk => ?_
theorem iInf_sum {f : ι → α → ℝ≥0∞} {s : Finset α} [Nonempty ι]
    (h : ∀ (t : Finset α) (i j : ι), ∃ k, ∀ a ∈ t, f k a ≤ f i a ∧ f k a ≤ f j a) :
    ⨅ i, ∑ a in s, f i a = ∑ a in s, ⨅ i, f i a := by
  induction' s using Finset.cons_induction_on with a s ha ih
  · simp only [Finset.sum_empty, ciInf_const]
  · simp only [Finset.sum_cons, ← ih]
    refine (iInf_add_iInf fun i j => ?_).symm
    refine (h (Finset.cons a s ha) i j).imp fun k hk => ?_
    

Proof state:
case h₂
α : Type u_1
β : Type u_2
a✝ b c d : ℝ≥0∞
r p q : ℝ≥0
ι : Sort u_3
f✝ g : ι → ℝ≥0∞
f : ι → α → ℝ≥0∞
inst✝ : Nonempty ι
h : ∀ (t : Finset α) (i j : ι), ∃ k, ∀ a ∈ t, f k a ≤ f i a ∧ f k a ≤ f j a
a : α
s : Finset α
ha : a ∉ s
ih : ⨅ i, ∑ a in s, f i a = ∑ a in s, ⨅ i, f i a
i j k : ι
hk : ∀ a_1 ∈ Finset.cons a s ha, f k a_1 ≤ f i a_1 ∧ f k a_1 ≤ f j a_1
⊢ f k a + ∑ a in s, f k a ≤ f i a + ∑ a in s, f j a

Next tactic:
rw [Finset.forall_mem_cons] at hk
theorem iInf_sum {f : ι → α → ℝ≥0∞} {s : Finset α} [Nonempty ι]
    (h : ∀ (t : Finset α) (i j : ι), ∃ k, ∀ a ∈ t, f k a ≤ f i a ∧ f k a ≤ f j a) :
    ⨅ i, ∑ a in s, f i a = ∑ a in s, ⨅ i, f i a := by
  induction' s using Finset.cons_induction_on with a s ha ih
  · simp only [Finset.sum_empty, ciInf_const]
  · simp only [Finset.sum_cons, ← ih]
    refine (iInf_add_iInf fun i j => ?_).symm
    refine (h (Finset.cons a s ha) i j).imp fun k hk => ?_
    rw [Finset.forall_mem_cons] at hk
    

Proof state:
case h₂
α : Type u_1
β : Type u_2
a✝ b c d : ℝ≥0∞
r p q : ℝ≥0
ι : Sort u_3
f✝ g : ι → ℝ≥0∞
f : ι → α → ℝ≥0∞
inst✝ : Nonempty ι
h : ∀ (t : Finset α) (i j : ι), ∃ k, ∀ a ∈ t, f k a ≤ f i a ∧ f k a ≤ f j a
a : α
s : Finset α
ha : a ∉ s
ih : ⨅ i, ∑ a in s, f i a = ∑ a in s, ⨅ i, f i a
i j k : ι
hk : (f k a ≤ f i a ∧ f k a ≤ f j a) ∧ ∀ x ∈ s, f k x ≤ f i x ∧ f k x ≤ f j x
⊢ f k a + ∑ a in s, f k a ≤ f i a + ∑ a in s, f j a

Next tactic:
exact add_le_add hk.1.1 (Finset.sum_le_sum fun a ha => (hk.2 a ha).2)
/-- If `x ≠ ∞`, then right multiplication by `x` maps infimum over a nonempty type to infimum. See
also `ENNReal.iInf_mul_of_ne` that assumes `x ≠ 0` but does not require `[Nonempty ι]`. -/
theorem iInf_mul {ι} [Nonempty ι] {f : ι → ℝ≥0∞} {x : ℝ≥0∞} (h : x ≠ ∞) :
    iInf f * x = ⨅ i, f i * x := by
  

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
ι✝ : Sort u_3
f✝ g : ι✝ → ℝ≥0∞
ι : Sort u_4
inst✝ : Nonempty ι
f : ι → ℝ≥0∞
x : ℝ≥0∞
h : x ≠ ⊤
⊢ iInf f * x = ⨅ i, f i * x

Next tactic:
by_cases h0 : x = 0
/-- If `x ≠ ∞`, then right multiplication by `x` maps infimum over a nonempty type to infimum. See
also `ENNReal.iInf_mul_of_ne` that assumes `x ≠ 0` but does not require `[Nonempty ι]`. -/
theorem iInf_mul {ι} [Nonempty ι] {f : ι → ℝ≥0∞} {x : ℝ≥0∞} (h : x ≠ ∞) :
    iInf f * x = ⨅ i, f i * x := by
  by_cases h0 : x = 0
  · 

Proof state:
case pos
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
ι✝ : Sort u_3
f✝ g : ι✝ → ℝ≥0∞
ι : Sort u_4
inst✝ : Nonempty ι
f : ι → ℝ≥0∞
x : ℝ≥0∞
h : x ≠ ⊤
h0 : x = 0
⊢ iInf f * x = ⨅ i, f i * x

Next tactic:
simp only [h0, mul_zero, iInf_const]
/-- If `x ≠ ∞`, then right multiplication by `x` maps infimum over a nonempty type to infimum. See
also `ENNReal.iInf_mul_of_ne` that assumes `x ≠ 0` but does not require `[Nonempty ι]`. -/
theorem iInf_mul {ι} [Nonempty ι] {f : ι → ℝ≥0∞} {x : ℝ≥0∞} (h : x ≠ ∞) :
    iInf f * x = ⨅ i, f i * x := by
  by_cases h0 : x = 0
  · simp only [h0, mul_zero, iInf_const]
  · 

Proof state:
case neg
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
ι✝ : Sort u_3
f✝ g : ι✝ → ℝ≥0∞
ι : Sort u_4
inst✝ : Nonempty ι
f : ι → ℝ≥0∞
x : ℝ≥0∞
h : x ≠ ⊤
h0 : ¬x = 0
⊢ iInf f * x = ⨅ i, f i * x

Next tactic:
exact iInf_mul_of_ne h0 h
/-- If `x ≠ ∞`, then left multiplication by `x` maps infimum over a nonempty type to infimum. See
also `ENNReal.mul_iInf_of_ne` that assumes `x ≠ 0` but does not require `[Nonempty ι]`. -/
theorem mul_iInf {ι} [Nonempty ι] {f : ι → ℝ≥0∞} {x : ℝ≥0∞} (h : x ≠ ∞) :
    x * iInf f = ⨅ i, x * f i := by 

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
ι✝ : Sort u_3
f✝ g : ι✝ → ℝ≥0∞
ι : Sort u_4
inst✝ : Nonempty ι
f : ι → ℝ≥0∞
x : ℝ≥0∞
h : x ≠ ⊤
⊢ x * iInf f = ⨅ i, x * f i

Next tactic:
simpa only [mul_comm] using iInf_mul h
/-- If `x ≠ 0` and `x ≠ ∞`, then left multiplication by `x` maps infimum to infimum.
See also `ENNReal.mul_iInf` that assumes `[Nonempty ι]` but does not require `x ≠ 0`. -/
theorem mul_iInf_of_ne {ι} {f : ι → ℝ≥0∞} {x : ℝ≥0∞} (h0 : x ≠ 0) (h : x ≠ ∞) :
    x * iInf f = ⨅ i, x * f i := by 

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
ι✝ : Sort u_3
f✝ g : ι✝ → ℝ≥0∞
ι : Sort u_4
f : ι → ℝ≥0∞
x : ℝ≥0∞
h0 : x ≠ 0
h : x ≠ ⊤
⊢ x * iInf f = ⨅ i, x * f i

Next tactic:
simpa only [mul_comm] using iInf_mul_of_ne h0 h
@[simp]
theorem iSup_zero_eq_zero {ι : Sort*} : ⨆ _ : ι, (0 : ℝ≥0∞) = 0 := by 

Proof state:
α : Type u_1
β : Type u_2
a b c d : ℝ≥0∞
r p q : ℝ≥0
ι : Sort u_3
⊢ ⨆ x, 0 = 0

Next tactic:
simp
theorem image_coe_nnreal_ennreal (h : t.OrdConnected) : ((↑) '' t : Set ℝ≥0∞).OrdConnected := by
  

Proof state:
α : Type u_1
β : Type u_2
s : Set ℝ
t : Set ℝ≥0
u : Set ℝ≥0∞
h : OrdConnected t
⊢ OrdConnected (ofNNReal '' t)

Next tactic:
refine' ⟨ball_image_iff.2 fun x hx => ball_image_iff.2 fun y hy z hz => _⟩
theorem image_coe_nnreal_ennreal (h : t.OrdConnected) : ((↑) '' t : Set ℝ≥0∞).OrdConnected := by
  refine' ⟨ball_image_iff.2 fun x hx => ball_image_iff.2 fun y hy z hz => _⟩
  

Proof state:
α : Type u_1
β : Type u_2
s : Set ℝ
t : Set ℝ≥0
u : Set ℝ≥0∞
h : OrdConnected t
x : ℝ≥0
hx : x ∈ t
y : ℝ≥0
hy : y ∈ t
z : ℝ≥0∞
hz : z ∈ Icc ↑x ↑y
⊢ z ∈ ofNNReal '' t

Next tactic:
rcases ENNReal.le_coe_iff.1 hz.2 with ⟨z, rfl, -⟩
theorem image_coe_nnreal_ennreal (h : t.OrdConnected) : ((↑) '' t : Set ℝ≥0∞).OrdConnected := by
  refine' ⟨ball_image_iff.2 fun x hx => ball_image_iff.2 fun y hy z hz => _⟩
  rcases ENNReal.le_coe_iff.1 hz.2 with ⟨z, rfl, -⟩
  

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
s : Set ℝ
t : Set ℝ≥0
u : Set ℝ≥0∞
h : OrdConnected t
x : ℝ≥0
hx : x ∈ t
y : ℝ≥0
hy : y ∈ t
z : ℝ≥0
hz : ↑z ∈ Icc ↑x ↑y
⊢ ↑z ∈ ofNNReal '' t

Next tactic:
exact mem_image_of_mem _ (h.out hx hy ⟨ENNReal.coe_le_coe.1 hz.1, ENNReal.coe_le_coe.1 hz.2⟩)
theorem image_ennreal_ofReal (h : s.OrdConnected) : (ENNReal.ofReal '' s).OrdConnected := by
  

Proof state:
α : Type u_1
β : Type u_2
s : Set ℝ
t : Set ℝ≥0
u : Set ℝ≥0∞
h : OrdConnected s
⊢ OrdConnected (ENNReal.ofReal '' s)

Next tactic:
simpa only [image_image] using h.image_real_toNNReal.image_coe_nnreal_ennreal
/-- An odd function on a linear ordered additive commutative group is strictly monotone on the whole
group provided that it is strictly monotone on `Set.Ici 0`. -/
theorem strictMono_of_odd_strictMonoOn_nonneg {f : G → H} (h₁ : ∀ x, f (-x) = -f x)
    (h₂ : StrictMonoOn f (Ici 0)) : StrictMono f := by
  

Proof state:
G : Type u_1
H : Type u_2
inst✝¹ : LinearOrderedAddCommGroup G
inst✝ : OrderedAddCommGroup H
f : G → H
h₁ : ∀ (x : G), f (-x) = -f x
h₂ : StrictMonoOn f (Ici 0)
⊢ StrictMono f

Next tactic:
refine' StrictMonoOn.Iic_union_Ici (fun x hx y hy hxy => neg_lt_neg_iff.1 _) h₂