l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem ediam_Ioo (a b : ℝ) : EMetric.diam (Ioo a b) = ENNReal.ofReal (b - a) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : PseudoEMetricSpace α
a b : ℝ
⊢ EMetric.diam (Ioo a b) = ENNReal.ofReal (b - a)

Next tactic:
rcases le_or_lt b a with (h | h)
@[simp]
theorem ediam_Ioo (a b : ℝ) : EMetric.diam (Ioo a b) = ENNReal.ofReal (b - a) := by
  rcases le_or_lt b a with (h | h)
  · 

Proof state:
case inl
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : PseudoEMetricSpace α
a b : ℝ
h : b ≤ a
⊢ EMetric.diam (Ioo a b) = ENNReal.ofReal (b - a)

Next tactic:
simp [h]
@[simp]
theorem ediam_Ioo (a b : ℝ) : EMetric.diam (Ioo a b) = ENNReal.ofReal (b - a) := by
  rcases le_or_lt b a with (h | h)
  · simp [h]
  · 

Proof state:
case inr
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : PseudoEMetricSpace α
a b : ℝ
h : a < b
⊢ EMetric.diam (Ioo a b) = ENNReal.ofReal (b - a)

Next tactic:
rw [Real.ediam_eq (isBounded_Ioo _ _), csSup_Ioo h, csInf_Ioo h]
@[simp]
theorem ediam_Icc (a b : ℝ) : EMetric.diam (Icc a b) = ENNReal.ofReal (b - a) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : PseudoEMetricSpace α
a b : ℝ
⊢ EMetric.diam (Icc a b) = ENNReal.ofReal (b - a)

Next tactic:
rcases le_or_lt a b with (h | h)
@[simp]
theorem ediam_Icc (a b : ℝ) : EMetric.diam (Icc a b) = ENNReal.ofReal (b - a) := by
  rcases le_or_lt a b with (h | h)
  · 

Proof state:
case inl
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : PseudoEMetricSpace α
a b : ℝ
h : a ≤ b
⊢ EMetric.diam (Icc a b) = ENNReal.ofReal (b - a)

Next tactic:
rw [Real.ediam_eq (isBounded_Icc _ _), csSup_Icc h, csInf_Icc h]
@[simp]
theorem ediam_Icc (a b : ℝ) : EMetric.diam (Icc a b) = ENNReal.ofReal (b - a) := by
  rcases le_or_lt a b with (h | h)
  · rw [Real.ediam_eq (isBounded_Icc _ _), csSup_Icc h, csInf_Icc h]
  · 

Proof state:
case inr
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : PseudoEMetricSpace α
a b : ℝ
h : b < a
⊢ EMetric.diam (Icc a b) = ENNReal.ofReal (b - a)

Next tactic:
simp [h, h.le]
theorem diam_Icc {a b : ℝ} (h : a ≤ b) : Metric.diam (Icc a b) = b - a := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : PseudoEMetricSpace α
a b : ℝ
h : a ≤ b
⊢ Metric.diam (Icc a b) = b - a

Next tactic:
simp [Metric.diam, ENNReal.toReal_ofReal (sub_nonneg.2 h)]
theorem diam_Ico {a b : ℝ} (h : a ≤ b) : Metric.diam (Ico a b) = b - a := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : PseudoEMetricSpace α
a b : ℝ
h : a ≤ b
⊢ Metric.diam (Ico a b) = b - a

Next tactic:
simp [Metric.diam, ENNReal.toReal_ofReal (sub_nonneg.2 h)]
theorem diam_Ioc {a b : ℝ} (h : a ≤ b) : Metric.diam (Ioc a b) = b - a := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : PseudoEMetricSpace α
a b : ℝ
h : a ≤ b
⊢ Metric.diam (Ioc a b) = b - a

Next tactic:
simp [Metric.diam, ENNReal.toReal_ofReal (sub_nonneg.2 h)]
theorem diam_Ioo {a b : ℝ} (h : a ≤ b) : Metric.diam (Ioo a b) = b - a := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : PseudoEMetricSpace α
a b : ℝ
h : a ≤ b
⊢ Metric.diam (Ioo a b) = b - a

Next tactic:
simp [Metric.diam, ENNReal.toReal_ofReal (sub_nonneg.2 h)]
/-- If `edist (f n) (f (n+1))` is bounded above by a function `d : ℕ → ℝ≥0∞`,
then the distance from `f n` to the limit is bounded by `∑'_{k=n}^∞ d k`. -/
theorem edist_le_tsum_of_edist_le_of_tendsto {f : ℕ → α} (d : ℕ → ℝ≥0∞)
    (hf : ∀ n, edist (f n) (f n.succ) ≤ d n) {a : α} (ha : Tendsto f atTop (𝓝 a)) (n : ℕ) :
    edist (f n) a ≤ ∑' m, d (n + m) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : PseudoEMetricSpace α
f : ℕ → α
d : ℕ → ℝ≥0∞
hf : ∀ (n : ℕ), edist (f n) (f (Nat.succ n)) ≤ d n
a : α
ha : Tendsto f atTop (𝓝 a)
n : ℕ
⊢ edist (f n) a ≤ ∑' (m : ℕ), d (n + m)

Next tactic:
refine' le_of_tendsto (tendsto_const_nhds.edist ha) (mem_atTop_sets.2 ⟨n, fun m hnm => _⟩)
/-- If `edist (f n) (f (n+1))` is bounded above by a function `d : ℕ → ℝ≥0∞`,
then the distance from `f n` to the limit is bounded by `∑'_{k=n}^∞ d k`. -/
theorem edist_le_tsum_of_edist_le_of_tendsto {f : ℕ → α} (d : ℕ → ℝ≥0∞)
    (hf : ∀ n, edist (f n) (f n.succ) ≤ d n) {a : α} (ha : Tendsto f atTop (𝓝 a)) (n : ℕ) :
    edist (f n) a ≤ ∑' m, d (n + m) := by
  refine' le_of_tendsto (tendsto_const_nhds.edist ha) (mem_atTop_sets.2 ⟨n, fun m hnm => _⟩)
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : PseudoEMetricSpace α
f : ℕ → α
d : ℕ → ℝ≥0∞
hf : ∀ (n : ℕ), edist (f n) (f (Nat.succ n)) ≤ d n
a : α
ha : Tendsto f atTop (𝓝 a)
n m : ℕ
hnm : m ≥ n
⊢ m ∈ {x | (fun c => edist (f n) (f c) ≤ ∑' (m : ℕ), d (n + m)) x}

Next tactic:
refine' le_trans (edist_le_Ico_sum_of_edist_le hnm fun _ _ => hf _) _
/-- If `edist (f n) (f (n+1))` is bounded above by a function `d : ℕ → ℝ≥0∞`,
then the distance from `f n` to the limit is bounded by `∑'_{k=n}^∞ d k`. -/
theorem edist_le_tsum_of_edist_le_of_tendsto {f : ℕ → α} (d : ℕ → ℝ≥0∞)
    (hf : ∀ n, edist (f n) (f n.succ) ≤ d n) {a : α} (ha : Tendsto f atTop (𝓝 a)) (n : ℕ) :
    edist (f n) a ≤ ∑' m, d (n + m) := by
  refine' le_of_tendsto (tendsto_const_nhds.edist ha) (mem_atTop_sets.2 ⟨n, fun m hnm => _⟩)
  refine' le_trans (edist_le_Ico_sum_of_edist_le hnm fun _ _ => hf _) _
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : PseudoEMetricSpace α
f : ℕ → α
d : ℕ → ℝ≥0∞
hf : ∀ (n : ℕ), edist (f n) (f (Nat.succ n)) ≤ d n
a : α
ha : Tendsto f atTop (𝓝 a)
n m : ℕ
hnm : m ≥ n
⊢ ∑ i in Finset.Ico n m, d i ≤ ∑' (m : ℕ), d (n + m)

Next tactic:
rw [Finset.sum_Ico_eq_sum_range]
/-- If `edist (f n) (f (n+1))` is bounded above by a function `d : ℕ → ℝ≥0∞`,
then the distance from `f n` to the limit is bounded by `∑'_{k=n}^∞ d k`. -/
theorem edist_le_tsum_of_edist_le_of_tendsto {f : ℕ → α} (d : ℕ → ℝ≥0∞)
    (hf : ∀ n, edist (f n) (f n.succ) ≤ d n) {a : α} (ha : Tendsto f atTop (𝓝 a)) (n : ℕ) :
    edist (f n) a ≤ ∑' m, d (n + m) := by
  refine' le_of_tendsto (tendsto_const_nhds.edist ha) (mem_atTop_sets.2 ⟨n, fun m hnm => _⟩)
  refine' le_trans (edist_le_Ico_sum_of_edist_le hnm fun _ _ => hf _) _
  rw [Finset.sum_Ico_eq_sum_range]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : PseudoEMetricSpace α
f : ℕ → α
d : ℕ → ℝ≥0∞
hf : ∀ (n : ℕ), edist (f n) (f (Nat.succ n)) ≤ d n
a : α
ha : Tendsto f atTop (𝓝 a)
n m : ℕ
hnm : m ≥ n
⊢ ∑ k in Finset.range (m - n), d (n + k) ≤ ∑' (m : ℕ), d (n + m)

Next tactic:
exact sum_le_tsum _ (fun _ _ => zero_le _) ENNReal.summable
/-- If `edist (f n) (f (n+1))` is bounded above by a function `d : ℕ → ℝ≥0∞`,
then the distance from `f 0` to the limit is bounded by `∑'_{k=0}^∞ d k`. -/
theorem edist_le_tsum_of_edist_le_of_tendsto₀ {f : ℕ → α} (d : ℕ → ℝ≥0∞)
    (hf : ∀ n, edist (f n) (f n.succ) ≤ d n) {a : α} (ha : Tendsto f atTop (𝓝 a)) :
    edist (f 0) a ≤ ∑' m, d m := by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : PseudoEMetricSpace α
f : ℕ → α
d : ℕ → ℝ≥0∞
hf : ∀ (n : ℕ), edist (f n) (f (Nat.succ n)) ≤ d n
a : α
ha : Tendsto f atTop (𝓝 a)
⊢ edist (f 0) a ≤ ∑' (m : ℕ), d m

Next tactic:
simpa using edist_le_tsum_of_edist_le_of_tendsto d hf ha 0
lemma truncateToReal_eq_toReal {t x : ℝ≥0∞} (t_ne_top : t ≠ ∞) (x_le : x ≤ t) :
    truncateToReal t x = x.toReal := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
t x : ℝ≥0∞
t_ne_top : t ≠ ⊤
x_le : x ≤ t
⊢ truncateToReal t x = ENNReal.toReal x

Next tactic:
have x_lt_top : x < ∞ := lt_of_le_of_lt x_le t_ne_top.lt_top
lemma truncateToReal_eq_toReal {t x : ℝ≥0∞} (t_ne_top : t ≠ ∞) (x_le : x ≤ t) :
    truncateToReal t x = x.toReal := by
  have x_lt_top : x < ∞ := lt_of_le_of_lt x_le t_ne_top.lt_top
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
t x : ℝ≥0∞
t_ne_top : t ≠ ⊤
x_le : x ≤ t
x_lt_top : x < ⊤
⊢ truncateToReal t x = ENNReal.toReal x

Next tactic:
have obs : min t x ≠ ∞ := by
    simp_all only [ne_eq, ge_iff_le, min_eq_top, false_and, not_false_eq_true]
lemma truncateToReal_eq_toReal {t x : ℝ≥0∞} (t_ne_top : t ≠ ∞) (x_le : x ≤ t) :
    truncateToReal t x = x.toReal := by
  have x_lt_top : x < ∞ := lt_of_le_of_lt x_le t_ne_top.lt_top
  have obs : min t x ≠ ∞ := by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
t x : ℝ≥0∞
t_ne_top : t ≠ ⊤
x_le : x ≤ t
x_lt_top : x < ⊤
⊢ min t x ≠ ⊤

Next tactic:
simp_all only [ne_eq, ge_iff_le, min_eq_top, false_and, not_false_eq_true]
lemma truncateToReal_eq_toReal {t x : ℝ≥0∞} (t_ne_top : t ≠ ∞) (x_le : x ≤ t) :
    truncateToReal t x = x.toReal := by
  have x_lt_top : x < ∞ := lt_of_le_of_lt x_le t_ne_top.lt_top
  have obs : min t x ≠ ∞ := by
    simp_all only [ne_eq, ge_iff_le, min_eq_top, false_and, not_false_eq_true]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
t x : ℝ≥0∞
t_ne_top : t ≠ ⊤
x_le : x ≤ t
x_lt_top : x < ⊤
obs : min t x ≠ ⊤
⊢ truncateToReal t x = ENNReal.toReal x

Next tactic:
exact (ENNReal.toReal_eq_toReal obs x_lt_top.ne).mpr (min_eq_right x_le)
lemma truncateToReal_le {t : ℝ≥0∞} (t_ne_top : t ≠ ∞) {x : ℝ≥0∞} :
    truncateToReal t x ≤ t.toReal := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
t : ℝ≥0∞
t_ne_top : t ≠ ⊤
x : ℝ≥0∞
⊢ truncateToReal t x ≤ ENNReal.toReal t

Next tactic:
rw [truncateToReal]
lemma truncateToReal_le {t : ℝ≥0∞} (t_ne_top : t ≠ ∞) {x : ℝ≥0∞} :
    truncateToReal t x ≤ t.toReal := by
  rw [truncateToReal]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
t : ℝ≥0∞
t_ne_top : t ≠ ⊤
x : ℝ≥0∞
⊢ ENNReal.toReal (min t x) ≤ ENNReal.toReal t

Next tactic:
apply (toReal_le_toReal _ t_ne_top).mpr (min_le_left t x)
lemma truncateToReal_le {t : ℝ≥0∞} (t_ne_top : t ≠ ∞) {x : ℝ≥0∞} :
    truncateToReal t x ≤ t.toReal := by
  rw [truncateToReal]
  apply (toReal_le_toReal _ t_ne_top).mpr (min_le_left t x)
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
t : ℝ≥0∞
t_ne_top : t ≠ ⊤
x : ℝ≥0∞
⊢ min t x ≠ ⊤

Next tactic:
simp_all only [ne_eq, ge_iff_le, min_eq_top, false_and, not_false_eq_true]
/-- The truncated cast `ENNReal.truncateToReal t : ℝ≥0∞ → ℝ` is monotone when `t ≠ ∞`. -/
lemma monotone_truncateToReal {t : ℝ≥0∞} (t_ne_top : t ≠ ∞) : Monotone (truncateToReal t) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
t : ℝ≥0∞
t_ne_top : t ≠ ⊤
⊢ Monotone (truncateToReal t)

Next tactic:
intro x y x_le_y
/-- The truncated cast `ENNReal.truncateToReal t : ℝ≥0∞ → ℝ` is monotone when `t ≠ ∞`. -/
lemma monotone_truncateToReal {t : ℝ≥0∞} (t_ne_top : t ≠ ∞) : Monotone (truncateToReal t) := by
  intro x y x_le_y
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
t : ℝ≥0∞
t_ne_top : t ≠ ⊤
x y : ℝ≥0∞
x_le_y : x ≤ y
⊢ truncateToReal t x ≤ truncateToReal t y

Next tactic:
have obs_x : min t x ≠ ∞ := by
    simp_all only [ne_eq, ge_iff_le, min_eq_top, false_and, not_false_eq_true]
/-- The truncated cast `ENNReal.truncateToReal t : ℝ≥0∞ → ℝ` is monotone when `t ≠ ∞`. -/
lemma monotone_truncateToReal {t : ℝ≥0∞} (t_ne_top : t ≠ ∞) : Monotone (truncateToReal t) := by
  intro x y x_le_y
  have obs_x : min t x ≠ ∞ := by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
t : ℝ≥0∞
t_ne_top : t ≠ ⊤
x y : ℝ≥0∞
x_le_y : x ≤ y
⊢ min t x ≠ ⊤

Next tactic:
simp_all only [ne_eq, ge_iff_le, min_eq_top, false_and, not_false_eq_true]
/-- The truncated cast `ENNReal.truncateToReal t : ℝ≥0∞ → ℝ` is monotone when `t ≠ ∞`. -/
lemma monotone_truncateToReal {t : ℝ≥0∞} (t_ne_top : t ≠ ∞) : Monotone (truncateToReal t) := by
  intro x y x_le_y
  have obs_x : min t x ≠ ∞ := by
    simp_all only [ne_eq, ge_iff_le, min_eq_top, false_and, not_false_eq_true]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
t : ℝ≥0∞
t_ne_top : t ≠ ⊤
x y : ℝ≥0∞
x_le_y : x ≤ y
obs_x : min t x ≠ ⊤
⊢ truncateToReal t x ≤ truncateToReal t y

Next tactic:
have obs_y : min t y ≠ ∞ := by
    simp_all only [ne_eq, ge_iff_le, min_eq_top, false_and, not_false_eq_true]
/-- The truncated cast `ENNReal.truncateToReal t : ℝ≥0∞ → ℝ` is monotone when `t ≠ ∞`. -/
lemma monotone_truncateToReal {t : ℝ≥0∞} (t_ne_top : t ≠ ∞) : Monotone (truncateToReal t) := by
  intro x y x_le_y
  have obs_x : min t x ≠ ∞ := by
    simp_all only [ne_eq, ge_iff_le, min_eq_top, false_and, not_false_eq_true]
  have obs_y : min t y ≠ ∞ := by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
t : ℝ≥0∞
t_ne_top : t ≠ ⊤
x y : ℝ≥0∞
x_le_y : x ≤ y
obs_x : min t x ≠ ⊤
⊢ min t y ≠ ⊤

Next tactic:
simp_all only [ne_eq, ge_iff_le, min_eq_top, false_and, not_false_eq_true]
/-- The truncated cast `ENNReal.truncateToReal t : ℝ≥0∞ → ℝ` is monotone when `t ≠ ∞`. -/
lemma monotone_truncateToReal {t : ℝ≥0∞} (t_ne_top : t ≠ ∞) : Monotone (truncateToReal t) := by
  intro x y x_le_y
  have obs_x : min t x ≠ ∞ := by
    simp_all only [ne_eq, ge_iff_le, min_eq_top, false_and, not_false_eq_true]
  have obs_y : min t y ≠ ∞ := by
    simp_all only [ne_eq, ge_iff_le, min_eq_top, false_and, not_false_eq_true]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
t : ℝ≥0∞
t_ne_top : t ≠ ⊤
x y : ℝ≥0∞
x_le_y : x ≤ y
obs_x : min t x ≠ ⊤
obs_y : min t y ≠ ⊤
⊢ truncateToReal t x ≤ truncateToReal t y

Next tactic:
exact (ENNReal.toReal_le_toReal obs_x obs_y).mpr (min_le_min_left t x_le_y)
/-- The truncated cast `ENNReal.truncateToReal t : ℝ≥0∞ → ℝ` is continuous when `t ≠ ∞`. -/
lemma continuous_truncateToReal {t : ℝ≥0∞} (t_ne_top : t ≠ ∞) : Continuous (truncateToReal t) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
t : ℝ≥0∞
t_ne_top : t ≠ ⊤
⊢ Continuous (truncateToReal t)

Next tactic:
apply continuousOn_toReal.comp_continuous (continuous_min.comp (Continuous.Prod.mk t))
/-- The truncated cast `ENNReal.truncateToReal t : ℝ≥0∞ → ℝ` is continuous when `t ≠ ∞`. -/
lemma continuous_truncateToReal {t : ℝ≥0∞} (t_ne_top : t ≠ ∞) : Continuous (truncateToReal t) := by
  apply continuousOn_toReal.comp_continuous (continuous_min.comp (Continuous.Prod.mk t))
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
t : ℝ≥0∞
t_ne_top : t ≠ ⊤
⊢ ∀ (x : ℝ≥0∞), ((fun p => min p.1 p.2) ∘ fun b => (t, b)) x ∈ {a | a ≠ ⊤}

Next tactic:
simp [t_ne_top]
/-- If `xs : ι → ℝ≥0∞` is bounded, then we have `liminf (toReal ∘ xs) = toReal (liminf xs)`. -/
lemma liminf_toReal_eq {ι : Type*} {F : Filter ι} [NeBot F] {b : ℝ≥0∞} (b_ne_top : b ≠ ∞)
    {xs : ι → ℝ≥0∞} (le_b : ∀ᶠ i in F, xs i ≤ b) :
    F.liminf (fun i ↦ (xs i).toReal) = (F.liminf xs).toReal := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
F : Filter ι
inst✝ : NeBot F
b : ℝ≥0∞
b_ne_top : b ≠ ⊤
xs : ι → ℝ≥0∞
le_b : ∀ᶠ (i : ι) in F, xs i ≤ b
⊢ liminf (fun i => ENNReal.toReal (xs i)) F = ENNReal.toReal (liminf xs F)

Next tactic:
have liminf_le : F.liminf xs ≤ b := by
    apply liminf_le_of_le ⟨0, by simp⟩
    intro y h
    obtain ⟨i, hi⟩ := (Eventually.and h le_b).exists
    exact hi.1.trans hi.2
/-- If `xs : ι → ℝ≥0∞` is bounded, then we have `liminf (toReal ∘ xs) = toReal (liminf xs)`. -/
lemma liminf_toReal_eq {ι : Type*} {F : Filter ι} [NeBot F] {b : ℝ≥0∞} (b_ne_top : b ≠ ∞)
    {xs : ι → ℝ≥0∞} (le_b : ∀ᶠ i in F, xs i ≤ b) :
    F.liminf (fun i ↦ (xs i).toReal) = (F.liminf xs).toReal := by
  have liminf_le : F.liminf xs ≤ b := by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
F : Filter ι
inst✝ : NeBot F
b : ℝ≥0∞
b_ne_top : b ≠ ⊤
xs : ι → ℝ≥0∞
le_b : ∀ᶠ (i : ι) in F, xs i ≤ b
⊢ liminf xs F ≤ b

Next tactic:
apply liminf_le_of_le ⟨0, by simp⟩
/-- If `xs : ι → ℝ≥0∞` is bounded, then we have `liminf (toReal ∘ xs) = toReal (liminf xs)`. -/
lemma liminf_toReal_eq {ι : Type*} {F : Filter ι} [NeBot F] {b : ℝ≥0∞} (b_ne_top : b ≠ ∞)
    {xs : ι → ℝ≥0∞} (le_b : ∀ᶠ i in F, xs i ≤ b) :
    F.liminf (fun i ↦ (xs i).toReal) = (F.liminf xs).toReal := by
  have liminf_le : F.liminf xs ≤ b := by
    apply liminf_le_of_le ⟨0, by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
F : Filter ι
inst✝ : NeBot F
b : ℝ≥0∞
b_ne_top : b ≠ ⊤
xs : ι → ℝ≥0∞
le_b : ∀ᶠ (i : ι) in F, xs i ≤ b
⊢ ∀ᶠ (x : ℝ≥0∞) in map xs F, (fun x x_1 => x ≥ x_1) x 0

Next tactic:
simp
/-- If `xs : ι → ℝ≥0∞` is bounded, then we have `liminf (toReal ∘ xs) = toReal (liminf xs)`. -/
lemma liminf_toReal_eq {ι : Type*} {F : Filter ι} [NeBot F] {b : ℝ≥0∞} (b_ne_top : b ≠ ∞)
    {xs : ι → ℝ≥0∞} (le_b : ∀ᶠ i in F, xs i ≤ b) :
    F.liminf (fun i ↦ (xs i).toReal) = (F.liminf xs).toReal := by
  have liminf_le : F.liminf xs ≤ b := by
    apply liminf_le_of_le ⟨0, by simp⟩
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
F : Filter ι
inst✝ : NeBot F
b : ℝ≥0∞
b_ne_top : b ≠ ⊤
xs : ι → ℝ≥0∞
le_b : ∀ᶠ (i : ι) in F, xs i ≤ b
⊢ ∀ (b_1 : ℝ≥0∞), (∀ᶠ (n : ι) in F, b_1 ≤ xs n) → b_1 ≤ b

Next tactic:
intro y h
/-- If `xs : ι → ℝ≥0∞` is bounded, then we have `liminf (toReal ∘ xs) = toReal (liminf xs)`. -/
lemma liminf_toReal_eq {ι : Type*} {F : Filter ι} [NeBot F] {b : ℝ≥0∞} (b_ne_top : b ≠ ∞)
    {xs : ι → ℝ≥0∞} (le_b : ∀ᶠ i in F, xs i ≤ b) :
    F.liminf (fun i ↦ (xs i).toReal) = (F.liminf xs).toReal := by
  have liminf_le : F.liminf xs ≤ b := by
    apply liminf_le_of_le ⟨0, by simp⟩
    intro y h
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
F : Filter ι
inst✝ : NeBot F
b : ℝ≥0∞
b_ne_top : b ≠ ⊤
xs : ι → ℝ≥0∞
le_b : ∀ᶠ (i : ι) in F, xs i ≤ b
y : ℝ≥0∞
h : ∀ᶠ (n : ι) in F, y ≤ xs n
⊢ y ≤ b

Next tactic:
obtain ⟨i, hi⟩ := (Eventually.and h le_b).exists
/-- If `xs : ι → ℝ≥0∞` is bounded, then we have `liminf (toReal ∘ xs) = toReal (liminf xs)`. -/
lemma liminf_toReal_eq {ι : Type*} {F : Filter ι} [NeBot F] {b : ℝ≥0∞} (b_ne_top : b ≠ ∞)
    {xs : ι → ℝ≥0∞} (le_b : ∀ᶠ i in F, xs i ≤ b) :
    F.liminf (fun i ↦ (xs i).toReal) = (F.liminf xs).toReal := by
  have liminf_le : F.liminf xs ≤ b := by
    apply liminf_le_of_le ⟨0, by simp⟩
    intro y h
    obtain ⟨i, hi⟩ := (Eventually.and h le_b).exists
    

Proof state:
case intro
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
F : Filter ι
inst✝ : NeBot F
b : ℝ≥0∞
b_ne_top : b ≠ ⊤
xs : ι → ℝ≥0∞
le_b : ∀ᶠ (i : ι) in F, xs i ≤ b
y : ℝ≥0∞
h : ∀ᶠ (n : ι) in F, y ≤ xs n
i : ι
hi : y ≤ xs i ∧ xs i ≤ b
⊢ y ≤ b

Next tactic:
exact hi.1.trans hi.2
/-- If `xs : ι → ℝ≥0∞` is bounded, then we have `liminf (toReal ∘ xs) = toReal (liminf xs)`. -/
lemma liminf_toReal_eq {ι : Type*} {F : Filter ι} [NeBot F] {b : ℝ≥0∞} (b_ne_top : b ≠ ∞)
    {xs : ι → ℝ≥0∞} (le_b : ∀ᶠ i in F, xs i ≤ b) :
    F.liminf (fun i ↦ (xs i).toReal) = (F.liminf xs).toReal := by
  have liminf_le : F.liminf xs ≤ b := by
    apply liminf_le_of_le ⟨0, by simp⟩
    intro y h
    obtain ⟨i, hi⟩ := (Eventually.and h le_b).exists
    exact hi.1.trans hi.2
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
F : Filter ι
inst✝ : NeBot F
b : ℝ≥0∞
b_ne_top : b ≠ ⊤
xs : ι → ℝ≥0∞
le_b : ∀ᶠ (i : ι) in F, xs i ≤ b
liminf_le : liminf xs F ≤ b
⊢ liminf (fun i => ENNReal.toReal (xs i)) F = ENNReal.toReal (liminf xs F)

Next tactic:
have aux : ∀ᶠ i in F, (xs i).toReal = ENNReal.truncateToReal b (xs i) := by
    filter_upwards [le_b] with i i_le_b
    simp only [truncateToReal_eq_toReal b_ne_top i_le_b, implies_true]
/-- If `xs : ι → ℝ≥0∞` is bounded, then we have `liminf (toReal ∘ xs) = toReal (liminf xs)`. -/
lemma liminf_toReal_eq {ι : Type*} {F : Filter ι} [NeBot F] {b : ℝ≥0∞} (b_ne_top : b ≠ ∞)
    {xs : ι → ℝ≥0∞} (le_b : ∀ᶠ i in F, xs i ≤ b) :
    F.liminf (fun i ↦ (xs i).toReal) = (F.liminf xs).toReal := by
  have liminf_le : F.liminf xs ≤ b := by
    apply liminf_le_of_le ⟨0, by simp⟩
    intro y h
    obtain ⟨i, hi⟩ := (Eventually.and h le_b).exists
    exact hi.1.trans hi.2
  have aux : ∀ᶠ i in F, (xs i).toReal = ENNReal.truncateToReal b (xs i) := by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
F : Filter ι
inst✝ : NeBot F
b : ℝ≥0∞
b_ne_top : b ≠ ⊤
xs : ι → ℝ≥0∞
le_b : ∀ᶠ (i : ι) in F, xs i ≤ b
liminf_le : liminf xs F ≤ b
⊢ ∀ᶠ (i : ι) in F, ENNReal.toReal (xs i) = truncateToReal b (xs i)

Next tactic:
filter_upwards [le_b] with i i_le_b
/-- If `xs : ι → ℝ≥0∞` is bounded, then we have `liminf (toReal ∘ xs) = toReal (liminf xs)`. -/
lemma liminf_toReal_eq {ι : Type*} {F : Filter ι} [NeBot F] {b : ℝ≥0∞} (b_ne_top : b ≠ ∞)
    {xs : ι → ℝ≥0∞} (le_b : ∀ᶠ i in F, xs i ≤ b) :
    F.liminf (fun i ↦ (xs i).toReal) = (F.liminf xs).toReal := by
  have liminf_le : F.liminf xs ≤ b := by
    apply liminf_le_of_le ⟨0, by simp⟩
    intro y h
    obtain ⟨i, hi⟩ := (Eventually.and h le_b).exists
    exact hi.1.trans hi.2
  have aux : ∀ᶠ i in F, (xs i).toReal = ENNReal.truncateToReal b (xs i) := by
    filter_upwards [le_b] with i i_le_b
    

Proof state:
case h
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
F : Filter ι
inst✝ : NeBot F
b : ℝ≥0∞
b_ne_top : b ≠ ⊤
xs : ι → ℝ≥0∞
le_b : ∀ᶠ (i : ι) in F, xs i ≤ b
liminf_le : liminf xs F ≤ b
i : ι
i_le_b : xs i ≤ b
⊢ ENNReal.toReal (xs i) = truncateToReal b (xs i)

Next tactic:
simp only [truncateToReal_eq_toReal b_ne_top i_le_b, implies_true]
/-- If `xs : ι → ℝ≥0∞` is bounded, then we have `liminf (toReal ∘ xs) = toReal (liminf xs)`. -/
lemma liminf_toReal_eq {ι : Type*} {F : Filter ι} [NeBot F] {b : ℝ≥0∞} (b_ne_top : b ≠ ∞)
    {xs : ι → ℝ≥0∞} (le_b : ∀ᶠ i in F, xs i ≤ b) :
    F.liminf (fun i ↦ (xs i).toReal) = (F.liminf xs).toReal := by
  have liminf_le : F.liminf xs ≤ b := by
    apply liminf_le_of_le ⟨0, by simp⟩
    intro y h
    obtain ⟨i, hi⟩ := (Eventually.and h le_b).exists
    exact hi.1.trans hi.2
  have aux : ∀ᶠ i in F, (xs i).toReal = ENNReal.truncateToReal b (xs i) := by
    filter_upwards [le_b] with i i_le_b
    simp only [truncateToReal_eq_toReal b_ne_top i_le_b, implies_true]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
F : Filter ι
inst✝ : NeBot F
b : ℝ≥0∞
b_ne_top : b ≠ ⊤
xs : ι → ℝ≥0∞
le_b : ∀ᶠ (i : ι) in F, xs i ≤ b
liminf_le : liminf xs F ≤ b
aux : ∀ᶠ (i : ι) in F, ENNReal.toReal (xs i) = truncateToReal b (xs i)
⊢ liminf (fun i => ENNReal.toReal (xs i)) F = ENNReal.toReal (liminf xs F)

Next tactic:
have aux' : (F.liminf xs).toReal = ENNReal.truncateToReal b (F.liminf xs) := by
    rw [truncateToReal_eq_toReal b_ne_top liminf_le]
/-- If `xs : ι → ℝ≥0∞` is bounded, then we have `liminf (toReal ∘ xs) = toReal (liminf xs)`. -/
lemma liminf_toReal_eq {ι : Type*} {F : Filter ι} [NeBot F] {b : ℝ≥0∞} (b_ne_top : b ≠ ∞)
    {xs : ι → ℝ≥0∞} (le_b : ∀ᶠ i in F, xs i ≤ b) :
    F.liminf (fun i ↦ (xs i).toReal) = (F.liminf xs).toReal := by
  have liminf_le : F.liminf xs ≤ b := by
    apply liminf_le_of_le ⟨0, by simp⟩
    intro y h
    obtain ⟨i, hi⟩ := (Eventually.and h le_b).exists
    exact hi.1.trans hi.2
  have aux : ∀ᶠ i in F, (xs i).toReal = ENNReal.truncateToReal b (xs i) := by
    filter_upwards [le_b] with i i_le_b
    simp only [truncateToReal_eq_toReal b_ne_top i_le_b, implies_true]
  have aux' : (F.liminf xs).toReal = ENNReal.truncateToReal b (F.liminf xs) := by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
F : Filter ι
inst✝ : NeBot F
b : ℝ≥0∞
b_ne_top : b ≠ ⊤
xs : ι → ℝ≥0∞
le_b : ∀ᶠ (i : ι) in F, xs i ≤ b
liminf_le : liminf xs F ≤ b
aux : ∀ᶠ (i : ι) in F, ENNReal.toReal (xs i) = truncateToReal b (xs i)
⊢ ENNReal.toReal (liminf xs F) = truncateToReal b (liminf xs F)

Next tactic:
rw [truncateToReal_eq_toReal b_ne_top liminf_le]
/-- If `xs : ι → ℝ≥0∞` is bounded, then we have `liminf (toReal ∘ xs) = toReal (liminf xs)`. -/
lemma liminf_toReal_eq {ι : Type*} {F : Filter ι} [NeBot F] {b : ℝ≥0∞} (b_ne_top : b ≠ ∞)
    {xs : ι → ℝ≥0∞} (le_b : ∀ᶠ i in F, xs i ≤ b) :
    F.liminf (fun i ↦ (xs i).toReal) = (F.liminf xs).toReal := by
  have liminf_le : F.liminf xs ≤ b := by
    apply liminf_le_of_le ⟨0, by simp⟩
    intro y h
    obtain ⟨i, hi⟩ := (Eventually.and h le_b).exists
    exact hi.1.trans hi.2
  have aux : ∀ᶠ i in F, (xs i).toReal = ENNReal.truncateToReal b (xs i) := by
    filter_upwards [le_b] with i i_le_b
    simp only [truncateToReal_eq_toReal b_ne_top i_le_b, implies_true]
  have aux' : (F.liminf xs).toReal = ENNReal.truncateToReal b (F.liminf xs) := by
    rw [truncateToReal_eq_toReal b_ne_top liminf_le]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
F : Filter ι
inst✝ : NeBot F
b : ℝ≥0∞
b_ne_top : b ≠ ⊤
xs : ι → ℝ≥0∞
le_b : ∀ᶠ (i : ι) in F, xs i ≤ b
liminf_le : liminf xs F ≤ b
aux : ∀ᶠ (i : ι) in F, ENNReal.toReal (xs i) = truncateToReal b (xs i)
aux' : ENNReal.toReal (liminf xs F) = truncateToReal b (liminf xs F)
⊢ liminf (fun i => ENNReal.toReal (xs i)) F = ENNReal.toReal (liminf xs F)

Next tactic:
simp_rw [liminf_congr aux, aux']