l3lab/ntp-mathlib huggingface dataset:
theorem locPathConnected_of_isOpen [LocPathConnectedSpace X] {U : Set X} (h : IsOpen U) :
    LocPathConnectedSpace U :=
  ⟨by
    rintro ⟨x, x_in⟩
    rw [nhds_subtype_eq_comap]
    constructor
    intro V
    rw [(HasBasis.comap ((↑) : U → X) (pathConnected_subset_basis h x_in)).mem_iff]
    constructor
    · rintro ⟨W, ⟨W_in, hW, hWU⟩, hWV⟩
      exact ⟨Subtype.val ⁻¹' W, ⟨⟨preimage_mem_comap W_in, hW.preimage_coe hWU⟩, hWV⟩⟩
    · rintro ⟨W, ⟨W_in, hW⟩, hWV⟩
      

Proof state:
case mk.mem_iff'.mpr.intro.intro.intro
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
x✝ y z : X
ι : Type u_3
F : Set X
inst✝ : LocPathConnectedSpace X
U : Set X
h : IsOpen U
x : X
x_in : x ∈ U
V W : Set ↑U
hWV : id W ⊆ V
W_in : W ∈ comap Subtype.val (𝓝 x)
hW : IsPathConnected W
⊢ ∃ i, (i ∈ 𝓝 x ∧ IsPathConnected i ∧ i ⊆ U) ∧ Subtype.val ⁻¹' id i ⊆ V

Next tactic:
refine'
        ⟨(↑) '' W,
          ⟨Filter.image_coe_mem_of_mem_comap (IsOpen.mem_nhds h x_in) W_in,
            hW.image continuous_subtype_val, Subtype.coe_image_subset U W⟩,
          _⟩
theorem locPathConnected_of_isOpen [LocPathConnectedSpace X] {U : Set X} (h : IsOpen U) :
    LocPathConnectedSpace U :=
  ⟨by
    rintro ⟨x, x_in⟩
    rw [nhds_subtype_eq_comap]
    constructor
    intro V
    rw [(HasBasis.comap ((↑) : U → X) (pathConnected_subset_basis h x_in)).mem_iff]
    constructor
    · rintro ⟨W, ⟨W_in, hW, hWU⟩, hWV⟩
      exact ⟨Subtype.val ⁻¹' W, ⟨⟨preimage_mem_comap W_in, hW.preimage_coe hWU⟩, hWV⟩⟩
    · rintro ⟨W, ⟨W_in, hW⟩, hWV⟩
      refine'
        ⟨(↑) '' W,
          ⟨Filter.image_coe_mem_of_mem_comap (IsOpen.mem_nhds h x_in) W_in,
            hW.image continuous_subtype_val, Subtype.coe_image_subset U W⟩,
          _⟩
      

Proof state:
case mk.mem_iff'.mpr.intro.intro.intro
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
x✝ y z : X
ι : Type u_3
F : Set X
inst✝ : LocPathConnectedSpace X
U : Set X
h : IsOpen U
x : X
x_in : x ∈ U
V W : Set ↑U
hWV : id W ⊆ V
W_in : W ∈ comap Subtype.val (𝓝 x)
hW : IsPathConnected W
⊢ Subtype.val ⁻¹' id (Subtype.val '' W) ⊆ V

Next tactic:
rintro x ⟨y, ⟨y_in, hy⟩⟩
theorem locPathConnected_of_isOpen [LocPathConnectedSpace X] {U : Set X} (h : IsOpen U) :
    LocPathConnectedSpace U :=
  ⟨by
    rintro ⟨x, x_in⟩
    rw [nhds_subtype_eq_comap]
    constructor
    intro V
    rw [(HasBasis.comap ((↑) : U → X) (pathConnected_subset_basis h x_in)).mem_iff]
    constructor
    · rintro ⟨W, ⟨W_in, hW, hWU⟩, hWV⟩
      exact ⟨Subtype.val ⁻¹' W, ⟨⟨preimage_mem_comap W_in, hW.preimage_coe hWU⟩, hWV⟩⟩
    · rintro ⟨W, ⟨W_in, hW⟩, hWV⟩
      refine'
        ⟨(↑) '' W,
          ⟨Filter.image_coe_mem_of_mem_comap (IsOpen.mem_nhds h x_in) W_in,
            hW.image continuous_subtype_val, Subtype.coe_image_subset U W⟩,
          _⟩
      rintro x ⟨y, ⟨y_in, hy⟩⟩
      

Proof state:
case mk.mem_iff'.mpr.intro.intro.intro.intro.intro
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
x✝¹ y✝ z : X
ι : Type u_3
F : Set X
inst✝ : LocPathConnectedSpace X
U : Set X
h : IsOpen U
x✝ : X
x_in : x✝ ∈ U
V W : Set ↑U
hWV : id W ⊆ V
W_in : W ∈ comap Subtype.val (𝓝 x✝)
hW : IsPathConnected W
x : { x // x ∈ U }
y : ↑U
y_in : y ∈ W
hy : ↑y = ↑x
⊢ x ∈ V

Next tactic:
rw [← Subtype.coe_injective hy]
theorem locPathConnected_of_isOpen [LocPathConnectedSpace X] {U : Set X} (h : IsOpen U) :
    LocPathConnectedSpace U :=
  ⟨by
    rintro ⟨x, x_in⟩
    rw [nhds_subtype_eq_comap]
    constructor
    intro V
    rw [(HasBasis.comap ((↑) : U → X) (pathConnected_subset_basis h x_in)).mem_iff]
    constructor
    · rintro ⟨W, ⟨W_in, hW, hWU⟩, hWV⟩
      exact ⟨Subtype.val ⁻¹' W, ⟨⟨preimage_mem_comap W_in, hW.preimage_coe hWU⟩, hWV⟩⟩
    · rintro ⟨W, ⟨W_in, hW⟩, hWV⟩
      refine'
        ⟨(↑) '' W,
          ⟨Filter.image_coe_mem_of_mem_comap (IsOpen.mem_nhds h x_in) W_in,
            hW.image continuous_subtype_val, Subtype.coe_image_subset U W⟩,
          _⟩
      rintro x ⟨y, ⟨y_in, hy⟩⟩
      rw [← Subtype.coe_injective hy]
      

Proof state:
case mk.mem_iff'.mpr.intro.intro.intro.intro.intro
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
x✝¹ y✝ z : X
ι : Type u_3
F : Set X
inst✝ : LocPathConnectedSpace X
U : Set X
h : IsOpen U
x✝ : X
x_in : x✝ ∈ U
V W : Set ↑U
hWV : id W ⊆ V
W_in : W ∈ comap Subtype.val (𝓝 x✝)
hW : IsPathConnected W
x : { x // x ∈ U }
y : ↑U
y_in : y ∈ W
hy : ↑y = ↑x
⊢ y ∈ V

Next tactic:
tauto
theorem IsOpen.isConnected_iff_isPathConnected [LocPathConnectedSpace X] {U : Set X}
    (U_op : IsOpen U) : IsPathConnected U ↔ IsConnected U := by
  

Proof state:
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
x y z : X
ι : Type u_3
F : Set X
inst✝ : LocPathConnectedSpace X
U : Set X
U_op : IsOpen U
⊢ IsPathConnected U ↔ IsConnected U

Next tactic:
rw [isConnected_iff_connectedSpace, isPathConnected_iff_pathConnectedSpace]
theorem IsOpen.isConnected_iff_isPathConnected [LocPathConnectedSpace X] {U : Set X}
    (U_op : IsOpen U) : IsPathConnected U ↔ IsConnected U := by
  rw [isConnected_iff_connectedSpace, isPathConnected_iff_pathConnectedSpace]
  

Proof state:
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
x y z : X
ι : Type u_3
F : Set X
inst✝ : LocPathConnectedSpace X
U : Set X
U_op : IsOpen U
⊢ PathConnectedSpace ↑U ↔ ConnectedSpace ↑U

Next tactic:
haveI := locPathConnected_of_isOpen U_op
theorem IsOpen.isConnected_iff_isPathConnected [LocPathConnectedSpace X] {U : Set X}
    (U_op : IsOpen U) : IsPathConnected U ↔ IsConnected U := by
  rw [isConnected_iff_connectedSpace, isPathConnected_iff_pathConnectedSpace]
  haveI := locPathConnected_of_isOpen U_op
  

Proof state:
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
x y z : X
ι : Type u_3
F : Set X
inst✝ : LocPathConnectedSpace X
U : Set X
U_op : IsOpen U
this : LocPathConnectedSpace ↑U
⊢ PathConnectedSpace ↑U ↔ ConnectedSpace ↑U

Next tactic:
exact pathConnectedSpace_iff_connectedSpace
theorem cast_ascFactorial : (a.ascFactorial b : S) = (ascPochhammer S b).eval (a + 1 : S) := by
  

Proof state:
S : Type u_1
inst✝ : Semiring S
a b : ℕ
⊢ ↑(ascFactorial a b) = Polynomial.eval (↑a + 1) (ascPochhammer S b)

Next tactic:
rw [← ascPochhammer_nat_eq_ascFactorial, ascPochhammer_eval_cast, Nat.cast_add, Nat.cast_one]
theorem cast_descFactorial :
    (a.descFactorial b : S) = (ascPochhammer S b).eval (a - (b - 1) : S) := by
  

Proof state:
S : Type u_1
inst✝ : Semiring S
a b : ℕ
⊢ ↑(descFactorial a b) = Polynomial.eval (↑(a - (b - 1))) (ascPochhammer S b)

Next tactic:
rw [← ascPochhammer_eval_cast, ascPochhammer_nat_eq_descFactorial]
theorem cast_descFactorial :
    (a.descFactorial b : S) = (ascPochhammer S b).eval (a - (b - 1) : S) := by
  rw [← ascPochhammer_eval_cast, ascPochhammer_nat_eq_descFactorial]
  

Proof state:
S : Type u_1
inst✝ : Semiring S
a b : ℕ
⊢ ↑(descFactorial a b) = ↑(descFactorial (a - (b - 1) + b - 1) b)

Next tactic:
induction' b with b
theorem cast_descFactorial :
    (a.descFactorial b : S) = (ascPochhammer S b).eval (a - (b - 1) : S) := by
  rw [← ascPochhammer_eval_cast, ascPochhammer_nat_eq_descFactorial]
  induction' b with b
  · 

Proof state:
case zero
S : Type u_1
inst✝ : Semiring S
a b : ℕ
⊢ ↑(descFactorial a zero) = ↑(descFactorial (a - (zero - 1) + zero - 1) zero)

Next tactic:
simp
theorem cast_descFactorial :
    (a.descFactorial b : S) = (ascPochhammer S b).eval (a - (b - 1) : S) := by
  rw [← ascPochhammer_eval_cast, ascPochhammer_nat_eq_descFactorial]
  induction' b with b
  · simp
  · 

Proof state:
case succ
S : Type u_1
inst✝ : Semiring S
a b✝ b : ℕ
n_ih✝ : ↑(descFactorial a b) = ↑(descFactorial (a - (b - 1) + b - 1) b)
⊢ ↑(descFactorial a (succ b)) = ↑(descFactorial (a - (succ b - 1) + succ b - 1) (succ b))

Next tactic:
simp_rw [add_succ, Nat.add_one_sub_one]
theorem cast_descFactorial :
    (a.descFactorial b : S) = (ascPochhammer S b).eval (a - (b - 1) : S) := by
  rw [← ascPochhammer_eval_cast, ascPochhammer_nat_eq_descFactorial]
  induction' b with b
  · simp
  · simp_rw [add_succ, Nat.add_one_sub_one]
    

Proof state:
case succ
S : Type u_1
inst✝ : Semiring S
a b✝ b : ℕ
n_ih✝ : ↑(descFactorial a b) = ↑(descFactorial (a - (b - 1) + b - 1) b)
⊢ ↑(descFactorial a (succ b)) = ↑(descFactorial (a - b + b) (succ b))

Next tactic:
obtain h | h := le_total a b
theorem cast_descFactorial :
    (a.descFactorial b : S) = (ascPochhammer S b).eval (a - (b - 1) : S) := by
  rw [← ascPochhammer_eval_cast, ascPochhammer_nat_eq_descFactorial]
  induction' b with b
  · simp
  · simp_rw [add_succ, Nat.add_one_sub_one]
    obtain h | h := le_total a b
    · 

Proof state:
case succ.inl
S : Type u_1
inst✝ : Semiring S
a b✝ b : ℕ
n_ih✝ : ↑(descFactorial a b) = ↑(descFactorial (a - (b - 1) + b - 1) b)
h : a ≤ b
⊢ ↑(descFactorial a (succ b)) = ↑(descFactorial (a - b + b) (succ b))

Next tactic:
rw [descFactorial_of_lt (lt_succ_of_le h), descFactorial_of_lt (lt_succ_of_le _)]
theorem cast_descFactorial :
    (a.descFactorial b : S) = (ascPochhammer S b).eval (a - (b - 1) : S) := by
  rw [← ascPochhammer_eval_cast, ascPochhammer_nat_eq_descFactorial]
  induction' b with b
  · simp
  · simp_rw [add_succ, Nat.add_one_sub_one]
    obtain h | h := le_total a b
    · rw [descFactorial_of_lt (lt_succ_of_le h), descFactorial_of_lt (lt_succ_of_le _)]
      

Proof state:
S : Type u_1
inst✝ : Semiring S
a b✝ b : ℕ
n_ih✝ : ↑(descFactorial a b) = ↑(descFactorial (a - (b - 1) + b - 1) b)
h : a ≤ b
⊢ a - b + b ≤ b

Next tactic:
rw [tsub_eq_zero_iff_le.mpr h, zero_add]
theorem cast_descFactorial :
    (a.descFactorial b : S) = (ascPochhammer S b).eval (a - (b - 1) : S) := by
  rw [← ascPochhammer_eval_cast, ascPochhammer_nat_eq_descFactorial]
  induction' b with b
  · simp
  · simp_rw [add_succ, Nat.add_one_sub_one]
    obtain h | h := le_total a b
    · rw [descFactorial_of_lt (lt_succ_of_le h), descFactorial_of_lt (lt_succ_of_le _)]
      rw [tsub_eq_zero_iff_le.mpr h, zero_add]
    · 

Proof state:
case succ.inr
S : Type u_1
inst✝ : Semiring S
a b✝ b : ℕ
n_ih✝ : ↑(descFactorial a b) = ↑(descFactorial (a - (b - 1) + b - 1) b)
h : b ≤ a
⊢ ↑(descFactorial a (succ b)) = ↑(descFactorial (a - b + b) (succ b))

Next tactic:
rw [tsub_add_cancel_of_le h]
theorem cast_factorial : (a ! : S) = (ascPochhammer S a).eval 1 := by
  

Proof state:
S : Type u_1
inst✝ : Semiring S
a b : ℕ
⊢ ↑a ! = Polynomial.eval 1 (ascPochhammer S a)

Next tactic:
rw [← zero_ascFactorial, cast_ascFactorial, cast_zero, zero_add]
/-- Convenience lemma. The `a - 1` is not using truncated subtraction, as opposed to the definition
of `Nat.descFactorial` as a natural. -/
theorem cast_descFactorial_two : (a.descFactorial 2 : S) = a * (a - 1) := by
  

Proof state:
S : Type u_1
inst✝ : Ring S
a b : ℕ
⊢ ↑(descFactorial a 2) = ↑a * (↑a - 1)

Next tactic:
rw [cast_descFactorial]
/-- Convenience lemma. The `a - 1` is not using truncated subtraction, as opposed to the definition
of `Nat.descFactorial` as a natural. -/
theorem cast_descFactorial_two : (a.descFactorial 2 : S) = a * (a - 1) := by
  rw [cast_descFactorial]
  

Proof state:
S : Type u_1
inst✝ : Ring S
a b : ℕ
⊢ Polynomial.eval (↑(a - (2 - 1))) (ascPochhammer S 2) = ↑a * (↑a - 1)

Next tactic:
cases a
/-- Convenience lemma. The `a - 1` is not using truncated subtraction, as opposed to the definition
of `Nat.descFactorial` as a natural. -/
theorem cast_descFactorial_two : (a.descFactorial 2 : S) = a * (a - 1) := by
  rw [cast_descFactorial]
  cases a
  · 

Proof state:
case zero
S : Type u_1
inst✝ : Ring S
b : ℕ
⊢ Polynomial.eval (↑(zero - (2 - 1))) (ascPochhammer S 2) = ↑zero * (↑zero - 1)

Next tactic:
simp
/-- Convenience lemma. The `a - 1` is not using truncated subtraction, as opposed to the definition
of `Nat.descFactorial` as a natural. -/
theorem cast_descFactorial_two : (a.descFactorial 2 : S) = a * (a - 1) := by
  rw [cast_descFactorial]
  cases a
  · simp
  · 

Proof state:
case succ
S : Type u_1
inst✝ : Ring S
b n✝ : ℕ
⊢ Polynomial.eval (↑(succ n✝ - (2 - 1))) (ascPochhammer S 2) = ↑(succ n✝) * (↑(succ n✝) - 1)

Next tactic:
rw [succ_sub_succ, tsub_zero, cast_succ, add_sub_cancel, ascPochhammer_succ_right,
      ascPochhammer_one, Polynomial.X_mul, Polynomial.eval_mul_X, Polynomial.eval_add,
      Polynomial.eval_X, cast_one, Polynomial.eval_one]
theorem lintegral_nnnorm_eq_lintegral_edist (f : α → β) :
    ∫⁻ a, ‖f a‖₊ ∂μ = ∫⁻ a, edist (f a) 0 ∂μ := by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
m : MeasurableSpace α
μ ν : Measure α
inst✝² : MeasurableSpace δ
inst✝¹ : NormedAddCommGroup β
inst✝ : NormedAddCommGroup γ
f : α → β
⊢ ∫⁻ (a : α), ↑‖f a‖₊ ∂μ = ∫⁻ (a : α), edist (f a) 0 ∂μ

Next tactic:
simp only [edist_eq_coe_nnnorm]
theorem lintegral_norm_eq_lintegral_edist (f : α → β) :
    ∫⁻ a, ENNReal.ofReal ‖f a‖ ∂μ = ∫⁻ a, edist (f a) 0 ∂μ := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
m : MeasurableSpace α
μ ν : Measure α
inst✝² : MeasurableSpace δ
inst✝¹ : NormedAddCommGroup β
inst✝ : NormedAddCommGroup γ
f : α → β
⊢ ∫⁻ (a : α), ENNReal.ofReal ‖f a‖ ∂μ = ∫⁻ (a : α), edist (f a) 0 ∂μ

Next tactic:
simp only [ofReal_norm_eq_coe_nnnorm, edist_eq_coe_nnnorm]
theorem lintegral_edist_triangle {f g h : α → β} (hf : AEStronglyMeasurable f μ)
    (hh : AEStronglyMeasurable h μ) :
    (∫⁻ a, edist (f a) (g a) ∂μ) ≤ (∫⁻ a, edist (f a) (h a) ∂μ) + ∫⁻ a, edist (g a) (h a) ∂μ := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
m : MeasurableSpace α
μ ν : Measure α
inst✝² : MeasurableSpace δ
inst✝¹ : NormedAddCommGroup β
inst✝ : NormedAddCommGroup γ
f g h : α → β
hf : AEStronglyMeasurable f μ
hh : AEStronglyMeasurable h μ
⊢ ∫⁻ (a : α), edist (f a) (g a) ∂μ ≤ ∫⁻ (a : α), edist (f a) (h a) ∂μ + ∫⁻ (a : α), edist (g a) (h a) ∂μ

Next tactic:
rw [← lintegral_add_left' (hf.edist hh)]
theorem lintegral_edist_triangle {f g h : α → β} (hf : AEStronglyMeasurable f μ)
    (hh : AEStronglyMeasurable h μ) :
    (∫⁻ a, edist (f a) (g a) ∂μ) ≤ (∫⁻ a, edist (f a) (h a) ∂μ) + ∫⁻ a, edist (g a) (h a) ∂μ := by
  rw [← lintegral_add_left' (hf.edist hh)]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
m : MeasurableSpace α
μ ν : Measure α
inst✝² : MeasurableSpace δ
inst✝¹ : NormedAddCommGroup β
inst✝ : NormedAddCommGroup γ
f g h : α → β
hf : AEStronglyMeasurable f μ
hh : AEStronglyMeasurable h μ
⊢ ∫⁻ (a : α), edist (f a) (g a) ∂μ ≤ ∫⁻ (a : α), edist (f a) (h a) + edist (g a) (h a) ∂μ

Next tactic:
refine' lintegral_mono fun a => _
theorem lintegral_edist_triangle {f g h : α → β} (hf : AEStronglyMeasurable f μ)
    (hh : AEStronglyMeasurable h μ) :
    (∫⁻ a, edist (f a) (g a) ∂μ) ≤ (∫⁻ a, edist (f a) (h a) ∂μ) + ∫⁻ a, edist (g a) (h a) ∂μ := by
  rw [← lintegral_add_left' (hf.edist hh)]
  refine' lintegral_mono fun a => _
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
m : MeasurableSpace α
μ ν : Measure α
inst✝² : MeasurableSpace δ
inst✝¹ : NormedAddCommGroup β
inst✝ : NormedAddCommGroup γ
f g h : α → β
hf : AEStronglyMeasurable f μ
hh : AEStronglyMeasurable h μ
a : α
⊢ edist (f a) (g a) ≤ edist (f a) (h a) + edist (g a) (h a)

Next tactic:
apply edist_triangle_right
theorem lintegral_nnnorm_zero : (∫⁻ _ : α, ‖(0 : β)‖₊ ∂μ) = 0 := by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
m : MeasurableSpace α
μ ν : Measure α
inst✝² : MeasurableSpace δ
inst✝¹ : NormedAddCommGroup β
inst✝ : NormedAddCommGroup γ
⊢ ∫⁻ (x : α), ↑‖0‖₊ ∂μ = 0

Next tactic:
simp
theorem lintegral_nnnorm_neg {f : α → β} : (∫⁻ a, ‖(-f) a‖₊ ∂μ) = ∫⁻ a, ‖f a‖₊ ∂μ := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
m : MeasurableSpace α
μ ν : Measure α
inst✝² : MeasurableSpace δ
inst✝¹ : NormedAddCommGroup β
inst✝ : NormedAddCommGroup γ
f : α → β
⊢ ∫⁻ (a : α), ↑‖(-f) a‖₊ ∂μ = ∫⁻ (a : α), ↑‖f a‖₊ ∂μ

Next tactic:
simp only [Pi.neg_apply, nnnorm_neg]
theorem hasFiniteIntegral_iff_norm (f : α → β) :
    HasFiniteIntegral f μ ↔ (∫⁻ a, ENNReal.ofReal ‖f a‖ ∂μ) < ∞ := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
m : MeasurableSpace α
μ ν : Measure α
inst✝² : MeasurableSpace δ
inst✝¹ : NormedAddCommGroup β
inst✝ : NormedAddCommGroup γ
f : α → β
⊢ HasFiniteIntegral f ↔ ∫⁻ (a : α), ENNReal.ofReal ‖f a‖ ∂μ < ⊤

Next tactic:
simp only [HasFiniteIntegral, ofReal_norm_eq_coe_nnnorm]
theorem hasFiniteIntegral_iff_edist (f : α → β) :
    HasFiniteIntegral f μ ↔ (∫⁻ a, edist (f a) 0 ∂μ) < ∞ := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
m : MeasurableSpace α
μ ν : Measure α
inst✝² : MeasurableSpace δ
inst✝¹ : NormedAddCommGroup β
inst✝ : NormedAddCommGroup γ
f : α → β
⊢ HasFiniteIntegral f ↔ ∫⁻ (a : α), edist (f a) 0 ∂μ < ⊤

Next tactic:
simp only [hasFiniteIntegral_iff_norm, edist_dist, dist_zero_right]
theorem hasFiniteIntegral_iff_ofReal {f : α → ℝ} (h : 0 ≤ᵐ[μ] f) :
    HasFiniteIntegral f μ ↔ (∫⁻ a, ENNReal.ofReal (f a) ∂μ) < ∞ := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
m : MeasurableSpace α
μ ν : Measure α
inst✝² : MeasurableSpace δ
inst✝¹ : NormedAddCommGroup β
inst✝ : NormedAddCommGroup γ
f : α → ℝ
h : 0 ≤ᵐ[μ] f
⊢ HasFiniteIntegral f ↔ ∫⁻ (a : α), ENNReal.ofReal (f a) ∂μ < ⊤

Next tactic:
rw [HasFiniteIntegral, lintegral_nnnorm_eq_of_ae_nonneg h]
theorem hasFiniteIntegral_iff_ofNNReal {f : α → ℝ≥0} :
    HasFiniteIntegral (fun x => (f x : ℝ)) μ ↔ (∫⁻ a, f a ∂μ) < ∞ := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
m : MeasurableSpace α
μ ν : Measure α
inst✝² : MeasurableSpace δ
inst✝¹ : NormedAddCommGroup β
inst✝ : NormedAddCommGroup γ
f : α → ℝ≥0
⊢ (HasFiniteIntegral fun x => ↑(f x)) ↔ ∫⁻ (a : α), ↑(f a) ∂μ < ⊤

Next tactic:
simp [hasFiniteIntegral_iff_norm]
theorem HasFiniteIntegral.mono {f : α → β} {g : α → γ} (hg : HasFiniteIntegral g μ)
    (h : ∀ᵐ a ∂μ, ‖f a‖ ≤ ‖g a‖) : HasFiniteIntegral f μ := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
m : MeasurableSpace α
μ ν : Measure α
inst✝² : MeasurableSpace δ
inst✝¹ : NormedAddCommGroup β
inst✝ : NormedAddCommGroup γ
f : α → β
g : α → γ
hg : HasFiniteIntegral g
h : ∀ᵐ (a : α) ∂μ, ‖f a‖ ≤ ‖g a‖
⊢ HasFiniteIntegral f

Next tactic:
simp only [hasFiniteIntegral_iff_norm] at *
theorem HasFiniteIntegral.mono {f : α → β} {g : α → γ} (hg : HasFiniteIntegral g μ)
    (h : ∀ᵐ a ∂μ, ‖f a‖ ≤ ‖g a‖) : HasFiniteIntegral f μ := by
  simp only [hasFiniteIntegral_iff_norm] at *
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
m : MeasurableSpace α
μ ν : Measure α
inst✝² : MeasurableSpace δ
inst✝¹ : NormedAddCommGroup β
inst✝ : NormedAddCommGroup γ
f : α → β
g : α → γ
h : ∀ᵐ (a : α) ∂μ, ‖f a‖ ≤ ‖g a‖
hg : ∫⁻ (a : α), ENNReal.ofReal ‖g a‖ ∂μ < ⊤
⊢ ∫⁻ (a : α), ENNReal.ofReal ‖f a‖ ∂μ < ⊤

Next tactic:
calc
    (∫⁻ a, ENNReal.ofReal ‖f a‖ ∂μ) ≤ ∫⁻ a : α, ENNReal.ofReal ‖g a‖ ∂μ :=
      lintegral_mono_ae (h.mono fun a h => ofReal_le_ofReal h)
    _ < ∞ := hg
theorem hasFiniteIntegral_const_iff {c : β} :
    HasFiniteIntegral (fun _ : α => c) μ ↔ c = 0 ∨ μ univ < ∞ := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
m : MeasurableSpace α
μ ν : Measure α
inst✝² : MeasurableSpace δ
inst✝¹ : NormedAddCommGroup β
inst✝ : NormedAddCommGroup γ
c : β
⊢ (HasFiniteIntegral fun x => c) ↔ c = 0 ∨ ↑↑μ univ < ⊤

Next tactic:
simp [HasFiniteIntegral, lintegral_const, lt_top_iff_ne_top, ENNReal.mul_eq_top,
    or_iff_not_imp_left]
theorem hasFiniteIntegral_of_fintype [Fintype α] [IsFiniteMeasure μ] {f : α → β} :
    HasFiniteIntegral f μ :=
  hasFiniteIntegral_of_bounded (C := (Finset.sup .univ (fun a => ‖f a‖₊) : NNReal)) <| by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
m : MeasurableSpace α
μ ν : Measure α
inst✝⁴ : MeasurableSpace δ
inst✝³ : NormedAddCommGroup β
inst✝² : NormedAddCommGroup γ
inst✝¹ : Fintype α
inst✝ : IsFiniteMeasure μ
f : α → β
⊢ ∀ᵐ (a : α) ∂μ, ‖f a‖ ≤ ↑(Finset.sup Finset.univ fun a => ‖f a‖₊)

Next tactic:
apply ae_of_all μ
theorem hasFiniteIntegral_of_fintype [Fintype α] [IsFiniteMeasure μ] {f : α → β} :
    HasFiniteIntegral f μ :=
  hasFiniteIntegral_of_bounded (C := (Finset.sup .univ (fun a => ‖f a‖₊) : NNReal)) <| by
    apply ae_of_all μ
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
m : MeasurableSpace α
μ ν : Measure α
inst✝⁴ : MeasurableSpace δ
inst✝³ : NormedAddCommGroup β
inst✝² : NormedAddCommGroup γ
inst✝¹ : Fintype α
inst✝ : IsFiniteMeasure μ
f : α → β
⊢ ∀ (a : α), ‖f a‖ ≤ ↑(Finset.sup Finset.univ fun a => ‖f a‖₊)

Next tactic:
intro x
theorem hasFiniteIntegral_of_fintype [Fintype α] [IsFiniteMeasure μ] {f : α → β} :
    HasFiniteIntegral f μ :=
  hasFiniteIntegral_of_bounded (C := (Finset.sup .univ (fun a => ‖f a‖₊) : NNReal)) <| by
    apply ae_of_all μ
    intro x
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
m : MeasurableSpace α
μ ν : Measure α
inst✝⁴ : MeasurableSpace δ
inst✝³ : NormedAddCommGroup β
inst✝² : NormedAddCommGroup γ
inst✝¹ : Fintype α
inst✝ : IsFiniteMeasure μ
f : α → β
x : α
⊢ ‖f x‖ ≤ ↑(Finset.sup Finset.univ fun a => ‖f a‖₊)

Next tactic:
rw [← coe_nnnorm (f x)]
theorem hasFiniteIntegral_of_fintype [Fintype α] [IsFiniteMeasure μ] {f : α → β} :
    HasFiniteIntegral f μ :=
  hasFiniteIntegral_of_bounded (C := (Finset.sup .univ (fun a => ‖f a‖₊) : NNReal)) <| by
    apply ae_of_all μ
    intro x
    rw [← coe_nnnorm (f x)]
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
m : MeasurableSpace α
μ ν : Measure α
inst✝⁴ : MeasurableSpace δ
inst✝³ : NormedAddCommGroup β
inst✝² : NormedAddCommGroup γ
inst✝¹ : Fintype α
inst✝ : IsFiniteMeasure μ
f : α → β
x : α
⊢ ↑‖f x‖₊ ≤ ↑(Finset.sup Finset.univ fun a => ‖f a‖₊)

Next tactic:
apply NNReal.toReal_le_toReal
theorem hasFiniteIntegral_of_fintype [Fintype α] [IsFiniteMeasure μ] {f : α → β} :
    HasFiniteIntegral f μ :=
  hasFiniteIntegral_of_bounded (C := (Finset.sup .univ (fun a => ‖f a‖₊) : NNReal)) <| by
    apply ae_of_all μ
    intro x
    rw [← coe_nnnorm (f x)]
    apply NNReal.toReal_le_toReal
    

Proof state:
case h
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
m : MeasurableSpace α
μ ν : Measure α
inst✝⁴ : MeasurableSpace δ
inst✝³ : NormedAddCommGroup β
inst✝² : NormedAddCommGroup γ
inst✝¹ : Fintype α
inst✝ : IsFiniteMeasure μ
f : α → β
x : α
⊢ ‖f x‖₊ ≤ Finset.sup Finset.univ fun a => ‖f a‖₊

Next tactic:
apply Finset.le_sup (Finset.mem_univ x)
theorem HasFiniteIntegral.add_measure {f : α → β} (hμ : HasFiniteIntegral f μ)
    (hν : HasFiniteIntegral f ν) : HasFiniteIntegral f (μ + ν) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
m : MeasurableSpace α
μ ν : Measure α
inst✝² : MeasurableSpace δ
inst✝¹ : NormedAddCommGroup β
inst✝ : NormedAddCommGroup γ
f : α → β
hμ : HasFiniteIntegral f
hν : HasFiniteIntegral f
⊢ HasFiniteIntegral f

Next tactic:
simp only [HasFiniteIntegral, lintegral_add_measure] at *
theorem HasFiniteIntegral.add_measure {f : α → β} (hμ : HasFiniteIntegral f μ)
    (hν : HasFiniteIntegral f ν) : HasFiniteIntegral f (μ + ν) := by
  simp only [HasFiniteIntegral, lintegral_add_measure] at *
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
m : MeasurableSpace α
μ ν : Measure α
inst✝² : MeasurableSpace δ
inst✝¹ : NormedAddCommGroup β
inst✝ : NormedAddCommGroup γ
f : α → β
hμ : ∫⁻ (a : α), ↑‖f a‖₊ ∂μ < ⊤
hν : ∫⁻ (a : α), ↑‖f a‖₊ ∂ν < ⊤
⊢ ∫⁻ (a : α), ↑‖f a‖₊ ∂μ + ∫⁻ (a : α), ↑‖f a‖₊ ∂ν < ⊤

Next tactic:
exact add_lt_top.2 ⟨hμ, hν⟩
theorem HasFiniteIntegral.smul_measure {f : α → β} (h : HasFiniteIntegral f μ) {c : ℝ≥0∞}
    (hc : c ≠ ∞) : HasFiniteIntegral f (c • μ) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
m : MeasurableSpace α
μ ν : Measure α
inst✝² : MeasurableSpace δ
inst✝¹ : NormedAddCommGroup β
inst✝ : NormedAddCommGroup γ
f : α → β
h : HasFiniteIntegral f
c : ℝ≥0∞
hc : c ≠ ⊤
⊢ HasFiniteIntegral f

Next tactic:
simp only [HasFiniteIntegral, lintegral_smul_measure] at *