-- Mathlib/MeasureTheory/Integral/SetToL1.lean
theorem setToL1_nonneg {T : Set α → G' →L[ℝ] G''} {C : ℝ} (hT : DominatedFinMeasAdditive μ T C)
    (hT_nonneg : ∀ s, MeasurableSet s → μ s < ∞ → ∀ x, 0 ≤ x → 0 ≤ T s x) {f : α →₁[μ] G'}
    (hf : 0 ≤ f) : 0 ≤ setToL1 hT f

Proof state:
case refine_2
α : Type u_1
m : MeasurableSpace α
μ : Measure α
G' : Type u_7
G'' : Type u_8
inst✝⁴ : NormedLatticeAddCommGroup G''
inst✝³ : NormedSpace ℝ G''
inst✝² : CompleteSpace G''
inst✝¹ : NormedLatticeAddCommGroup G'
inst✝ : NormedSpace ℝ G'
T : Set α → G' →L[ℝ] G''
C : ℝ
hT : DominatedFinMeasAdditive μ T C
hT_nonneg : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → ∀ (x : G'), 0 ≤ x → 0 ≤ (T s) x
f : ↥(Lp G' 1 μ)
hf : 0 ≤ f
g✝ : { g // 0 ≤ g }
g : { g // 0 ≤ g }
this : ↑(coeSimpleFuncNonnegToLpNonneg 1 μ G' g) = ↑↑g
⊢ 0 ≤ (setToL1SCLM α G' μ hT) ↑g

Tactic:
exact setToL1S_nonneg (fun s => hT.eq_zero_of_measure_zero) hT.1 hT_nonneg g.2

Result:
no goals

Proof state:
α : Type u_1
m : MeasurableSpace α
μ : Measure α
G' : Type u_7
G'' : Type u_8
inst✝⁴ : NormedLatticeAddCommGroup G''
inst✝³ : NormedSpace ℝ G''
inst✝² : CompleteSpace G''
inst✝¹ : NormedLatticeAddCommGroup G'
inst✝ : NormedSpace ℝ G'
T : Set α → G' →L[ℝ] G''
C : ℝ
hT : DominatedFinMeasAdditive μ T C
hT_nonneg : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → ∀ (x : G'), 0 ≤ x → 0 ≤ (T s) x
f : ↥(Lp G' 1 μ)
hf : 0 ≤ f
⊢ ∀ (f : { g // 0 ≤ g }), 0 ≤ (setToL1 hT) ↑f

Tactic:
refine fun g =>
  @isClosed_property { g : α →₁ₛ[μ] G' // 0 ≤ g } { g : α →₁[μ] G' // 0 ≤ g } _ _
    (fun g => 0 ≤ setToL1 hT g)
    (denseRange_coeSimpleFuncNonnegToLpNonneg 1 μ G' one_ne_top) ?_ ?_ g

Result:
case refine_1
α : Type u_1
m : MeasurableSpace α
μ : Measure α
G' : Type u_7
G'' : Type u_8
inst✝⁴ : NormedLatticeAddCommGroup G''
inst✝³ : NormedSpace ℝ G''
inst✝² : CompleteSpace G''
inst✝¹ : NormedLatticeAddCommGroup G'
inst✝ : NormedSpace ℝ G'
T : Set α → G' →L[ℝ] G''
C : ℝ
hT : DominatedFinMeasAdditive μ T C
hT_nonneg : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → ∀ (x : G'), 0 ≤ x → 0 ≤ (T s) x
f : ↥(Lp G' 1 μ)
hf : 0 ≤ f
g : { g // 0 ≤ g }
⊢ IsClosed {x | (fun g => 0 ≤ (setToL1 hT) ↑g) x}

case refine_2
α : Type u_1
m : MeasurableSpace α
μ : Measure α
G' : Type u_7
G'' : Type u_8
inst✝⁴ : NormedLatticeAddCommGroup G''
inst✝³ : NormedSpace ℝ G''
inst✝² : CompleteSpace G''
inst✝¹ : NormedLatticeAddCommGroup G'
inst✝ : NormedSpace ℝ G'
T : Set α → G' →L[ℝ] G''
C : ℝ
hT : DominatedFinMeasAdditive μ T C
hT_nonneg : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → ∀ (x : G'), 0 ≤ x → 0 ≤ (T s) x
f : ↥(Lp G' 1 μ)
hf : 0 ≤ f
g : { g // 0 ≤ g }
⊢ ∀ (a : { g // 0 ≤ g }), (fun g => 0 ≤ (setToL1 hT) ↑g) (coeSimpleFuncNonnegToLpNonneg 1 μ G' a)

Proof state:
case refine_2
α : Type u_1
m : MeasurableSpace α
μ : Measure α
G' : Type u_7
G'' : Type u_8
inst✝⁴ : NormedLatticeAddCommGroup G''
inst✝³ : NormedSpace ℝ G''
inst✝² : CompleteSpace G''
inst✝¹ : NormedLatticeAddCommGroup G'
inst✝ : NormedSpace ℝ G'
T : Set α → G' →L[ℝ] G''
C : ℝ
hT : DominatedFinMeasAdditive μ T C
hT_nonneg : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → ∀ (x : G'), 0 ≤ x → 0 ≤ (T s) x
f : ↥(Lp G' 1 μ)
hf : 0 ≤ f
g✝ : { g // 0 ≤ g }
g : { g // 0 ≤ g }
this : ↑(coeSimpleFuncNonnegToLpNonneg 1 μ G' g) = ↑↑g
⊢ 0 ≤ (setToL1 hT) ↑(coeSimpleFuncNonnegToLpNonneg 1 μ G' g)

Tactic:
rw [this, setToL1_eq_setToL1SCLM]

Result:
case refine_2
α : Type u_1
m : MeasurableSpace α
μ : Measure α
G' : Type u_7
G'' : Type u_8
inst✝⁴ : NormedLatticeAddCommGroup G''
inst✝³ : NormedSpace ℝ G''
inst✝² : CompleteSpace G''
inst✝¹ : NormedLatticeAddCommGroup G'
inst✝ : NormedSpace ℝ G'
T : Set α → G' →L[ℝ] G''
C : ℝ
hT : DominatedFinMeasAdditive μ T C
hT_nonneg : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → ∀ (x : G'), 0 ≤ x → 0 ≤ (T s) x
f : ↥(Lp G' 1 μ)
hf : 0 ≤ f
g✝ : { g // 0 ≤ g }
g : { g // 0 ≤ g }
this : ↑(coeSimpleFuncNonnegToLpNonneg 1 μ G' g) = ↑↑g
⊢ 0 ≤ (setToL1SCLM α G' μ hT) ↑g

Proof state:
case refine_2
α : Type u_1
m : MeasurableSpace α
μ : Measure α
G' : Type u_7
G'' : Type u_8
inst✝⁴ : NormedLatticeAddCommGroup G''
inst✝³ : NormedSpace ℝ G''
inst✝² : CompleteSpace G''
inst✝¹ : NormedLatticeAddCommGroup G'
inst✝ : NormedSpace ℝ G'
T : Set α → G' →L[ℝ] G''
C : ℝ
hT : DominatedFinMeasAdditive μ T C
hT_nonneg : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → ∀ (x : G'), 0 ≤ x → 0 ≤ (T s) x
f : ↥(Lp G' 1 μ)
hf : 0 ≤ f
g : { g // 0 ≤ g }
⊢ ∀ (a : { g // 0 ≤ g }), (fun g => 0 ≤ (setToL1 hT) ↑g) (coeSimpleFuncNonnegToLpNonneg 1 μ G' a)

Tactic:
intro g

Result:
case refine_2
α : Type u_1
m : MeasurableSpace α
μ : Measure α
G' : Type u_7
G'' : Type u_8
inst✝⁴ : NormedLatticeAddCommGroup G''
inst✝³ : NormedSpace ℝ G''
inst✝² : CompleteSpace G''
inst✝¹ : NormedLatticeAddCommGroup G'
inst✝ : NormedSpace ℝ G'
T : Set α → G' →L[ℝ] G''
C : ℝ
hT : DominatedFinMeasAdditive μ T C
hT_nonneg : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → ∀ (x : G'), 0 ≤ x → 0 ≤ (T s) x
f : ↥(Lp G' 1 μ)
hf : 0 ≤ f
g✝ : { g // 0 ≤ g }
g : { g // 0 ≤ g }
⊢ 0 ≤ (setToL1 hT) ↑(coeSimpleFuncNonnegToLpNonneg 1 μ G' g)

Proof state:
α : Type u_1
m : MeasurableSpace α
μ : Measure α
G' : Type u_7
G'' : Type u_8
inst✝⁴ : NormedLatticeAddCommGroup G''
inst✝³ : NormedSpace ℝ G''
inst✝² : CompleteSpace G''
inst✝¹ : NormedLatticeAddCommGroup G'
inst✝ : NormedSpace ℝ G'
T : Set α → G' →L[ℝ] G''
C : ℝ
hT : DominatedFinMeasAdditive μ T C
hT_nonneg : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → ∀ (x : G'), 0 ≤ x → 0 ≤ (T s) x
f : ↥(Lp G' 1 μ)
hf : 0 ≤ f
⊢ 0 ≤ (setToL1 hT) f

Tactic:
suffices ∀ f : { g : α →₁[μ] G' // 0 ≤ g }, 0 ≤ setToL1 hT f from
  this (⟨f, hf⟩ : { g : α →₁[μ] G' // 0 ≤ g })

Result:
α : Type u_1
m : MeasurableSpace α
μ : Measure α
G' : Type u_7
G'' : Type u_8
inst✝⁴ : NormedLatticeAddCommGroup G''
inst✝³ : NormedSpace ℝ G''
inst✝² : CompleteSpace G''
inst✝¹ : NormedLatticeAddCommGroup G'
inst✝ : NormedSpace ℝ G'
T : Set α → G' →L[ℝ] G''
C : ℝ
hT : DominatedFinMeasAdditive μ T C
hT_nonneg : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → ∀ (x : G'), 0 ≤ x → 0 ≤ (T s) x
f : ↥(Lp G' 1 μ)
hf : 0 ≤ f
⊢ ∀ (f : { g // 0 ≤ g }), 0 ≤ (setToL1 hT) ↑f

Proof state:
case refine_1
α : Type u_1
m : MeasurableSpace α
μ : Measure α
G' : Type u_7
G'' : Type u_8
inst✝⁴ : NormedLatticeAddCommGroup G''
inst✝³ : NormedSpace ℝ G''
inst✝² : CompleteSpace G''
inst✝¹ : NormedLatticeAddCommGroup G'
inst✝ : NormedSpace ℝ G'
T : Set α → G' →L[ℝ] G''
C : ℝ
hT : DominatedFinMeasAdditive μ T C
hT_nonneg : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → ∀ (x : G'), 0 ≤ x → 0 ≤ (T s) x
f : ↥(Lp G' 1 μ)
hf : 0 ≤ f
g : { g // 0 ≤ g }
⊢ IsClosed {x | (fun g => 0 ≤ (setToL1 hT) ↑g) x}

Tactic:
exact isClosed_le continuous_zero ((setToL1 hT).continuous.comp continuous_induced_dom)

Result:
no goals

Proof state:
case refine_2
α : Type u_1
m : MeasurableSpace α
μ : Measure α
G' : Type u_7
G'' : Type u_8
inst✝⁴ : NormedLatticeAddCommGroup G''
inst✝³ : NormedSpace ℝ G''
inst✝² : CompleteSpace G''
inst✝¹ : NormedLatticeAddCommGroup G'
inst✝ : NormedSpace ℝ G'
T : Set α → G' →L[ℝ] G''
C : ℝ
hT : DominatedFinMeasAdditive μ T C
hT_nonneg : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → ∀ (x : G'), 0 ≤ x → 0 ≤ (T s) x
f : ↥(Lp G' 1 μ)
hf : 0 ≤ f
g✝ : { g // 0 ≤ g }
g : { g // 0 ≤ g }
⊢ 0 ≤ (setToL1 hT) ↑(coeSimpleFuncNonnegToLpNonneg 1 μ G' g)

Tactic:
have : (coeSimpleFuncNonnegToLpNonneg 1 μ G' g : α →₁[μ] G') = (g : α →₁ₛ[μ] G') := rfl

Result:
case refine_2
α : Type u_1
m : MeasurableSpace α
μ : Measure α
G' : Type u_7
G'' : Type u_8
inst✝⁴ : NormedLatticeAddCommGroup G''
inst✝³ : NormedSpace ℝ G''
inst✝² : CompleteSpace G''
inst✝¹ : NormedLatticeAddCommGroup G'
inst✝ : NormedSpace ℝ G'
T : Set α → G' →L[ℝ] G''
C : ℝ
hT : DominatedFinMeasAdditive μ T C
hT_nonneg : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → ∀ (x : G'), 0 ≤ x → 0 ≤ (T s) x
f : ↥(Lp G' 1 μ)
hf : 0 ≤ f
g✝ : { g // 0 ≤ g }
g : { g // 0 ≤ g }
this : ↑(coeSimpleFuncNonnegToLpNonneg 1 μ G' g) = ↑↑g
⊢ 0 ≤ (setToL1 hT) ↑(coeSimpleFuncNonnegToLpNonneg 1 μ G' g)