l3lab/ntp-mathlib huggingface dataset:
theorem submartingale_of_set_integral_le [IsFiniteMeasure μ] {f : ι → Ω → ℝ} (hadp : Adapted ℱ f)
    (hint : ∀ i, Integrable (f i) μ) (hf : ∀ i j : ι,
      i ≤ j → ∀ s : Set Ω, MeasurableSet[ℱ i] s → ∫ ω in s, f i ω ∂μ ≤ ∫ ω in s, f j ω ∂μ) :
    Submartingale f ℱ μ := by
  refine' ⟨hadp, fun i j hij => _, hint⟩
  

Proof state:
Ω : Type u_1
E : Type u_2
ι : Type u_3
inst✝⁴ : Preorder ι
m0 : MeasurableSpace Ω
μ : Measure Ω
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
f✝ g : ι → Ω → E
ℱ : Filtration ι m0
inst✝ : IsFiniteMeasure μ
f : ι → Ω → ℝ
hadp : Adapted ℱ f
hint : ∀ (i : ι), Integrable (f i)
hf : ∀ (i j : ι), i ≤ j → ∀ (s : Set Ω), MeasurableSet s → ∫ (ω : Ω) in s, f i ω ∂μ ≤ ∫ (ω : Ω) in s, f j ω ∂μ
i j : ι
hij : i ≤ j
⊢ f i ≤ᵐ[μ] μ[f j|↑ℱ i]

Next tactic:
suffices f i ≤ᵐ[μ.trim (ℱ.le i)] μ[f j|ℱ i] by exact ae_le_of_ae_le_trim this
theorem submartingale_of_set_integral_le [IsFiniteMeasure μ] {f : ι → Ω → ℝ} (hadp : Adapted ℱ f)
    (hint : ∀ i, Integrable (f i) μ) (hf : ∀ i j : ι,
      i ≤ j → ∀ s : Set Ω, MeasurableSet[ℱ i] s → ∫ ω in s, f i ω ∂μ ≤ ∫ ω in s, f j ω ∂μ) :
    Submartingale f ℱ μ := by
  refine' ⟨hadp, fun i j hij => _, hint⟩
  suffices f i ≤ᵐ[μ.trim (ℱ.le i)] μ[f j|ℱ i] by 

Proof state:
Ω : Type u_1
E : Type u_2
ι : Type u_3
inst✝⁴ : Preorder ι
m0 : MeasurableSpace Ω
μ : Measure Ω
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
f✝ g : ι → Ω → E
ℱ : Filtration ι m0
inst✝ : IsFiniteMeasure μ
f : ι → Ω → ℝ
hadp : Adapted ℱ f
hint : ∀ (i : ι), Integrable (f i)
hf : ∀ (i j : ι), i ≤ j → ∀ (s : Set Ω), MeasurableSet s → ∫ (ω : Ω) in s, f i ω ∂μ ≤ ∫ (ω : Ω) in s, f j ω ∂μ
i j : ι
hij : i ≤ j
this : f i ≤ᵐ[Measure.trim μ (_ : ↑ℱ i ≤ m0)] μ[f j|↑ℱ i]
⊢ f i ≤ᵐ[μ] μ[f j|↑ℱ i]

Next tactic:
exact ae_le_of_ae_le_trim this
theorem submartingale_of_set_integral_le [IsFiniteMeasure μ] {f : ι → Ω → ℝ} (hadp : Adapted ℱ f)
    (hint : ∀ i, Integrable (f i) μ) (hf : ∀ i j : ι,
      i ≤ j → ∀ s : Set Ω, MeasurableSet[ℱ i] s → ∫ ω in s, f i ω ∂μ ≤ ∫ ω in s, f j ω ∂μ) :
    Submartingale f ℱ μ := by
  refine' ⟨hadp, fun i j hij => _, hint⟩
  suffices f i ≤ᵐ[μ.trim (ℱ.le i)] μ[f j|ℱ i] by exact ae_le_of_ae_le_trim this
  

Proof state:
Ω : Type u_1
E : Type u_2
ι : Type u_3
inst✝⁴ : Preorder ι
m0 : MeasurableSpace Ω
μ : Measure Ω
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
f✝ g : ι → Ω → E
ℱ : Filtration ι m0
inst✝ : IsFiniteMeasure μ
f : ι → Ω → ℝ
hadp : Adapted ℱ f
hint : ∀ (i : ι), Integrable (f i)
hf : ∀ (i j : ι), i ≤ j → ∀ (s : Set Ω), MeasurableSet s → ∫ (ω : Ω) in s, f i ω ∂μ ≤ ∫ (ω : Ω) in s, f j ω ∂μ
i j : ι
hij : i ≤ j
⊢ f i ≤ᵐ[Measure.trim μ (_ : ↑ℱ i ≤ m0)] μ[f j|↑ℱ i]

Next tactic:
suffices 0 ≤ᵐ[μ.trim (ℱ.le i)] μ[f j|ℱ i] - f i by
    filter_upwards [this] with x hx
    rwa [← sub_nonneg]
theorem submartingale_of_set_integral_le [IsFiniteMeasure μ] {f : ι → Ω → ℝ} (hadp : Adapted ℱ f)
    (hint : ∀ i, Integrable (f i) μ) (hf : ∀ i j : ι,
      i ≤ j → ∀ s : Set Ω, MeasurableSet[ℱ i] s → ∫ ω in s, f i ω ∂μ ≤ ∫ ω in s, f j ω ∂μ) :
    Submartingale f ℱ μ := by
  refine' ⟨hadp, fun i j hij => _, hint⟩
  suffices f i ≤ᵐ[μ.trim (ℱ.le i)] μ[f j|ℱ i] by exact ae_le_of_ae_le_trim this
  suffices 0 ≤ᵐ[μ.trim (ℱ.le i)] μ[f j|ℱ i] - f i by
    

Proof state:
Ω : Type u_1
E : Type u_2
ι : Type u_3
inst✝⁴ : Preorder ι
m0 : MeasurableSpace Ω
μ : Measure Ω
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
f✝ g : ι → Ω → E
ℱ : Filtration ι m0
inst✝ : IsFiniteMeasure μ
f : ι → Ω → ℝ
hadp : Adapted ℱ f
hint : ∀ (i : ι), Integrable (f i)
hf : ∀ (i j : ι), i ≤ j → ∀ (s : Set Ω), MeasurableSet s → ∫ (ω : Ω) in s, f i ω ∂μ ≤ ∫ (ω : Ω) in s, f j ω ∂μ
i j : ι
hij : i ≤ j
this : 0 ≤ᵐ[Measure.trim μ (_ : ↑ℱ i ≤ m0)] μ[f j|↑ℱ i] - f i
⊢ f i ≤ᵐ[Measure.trim μ (_ : ↑ℱ i ≤ m0)] μ[f j|↑ℱ i]

Next tactic:
filter_upwards [this] with x hx
theorem submartingale_of_set_integral_le [IsFiniteMeasure μ] {f : ι → Ω → ℝ} (hadp : Adapted ℱ f)
    (hint : ∀ i, Integrable (f i) μ) (hf : ∀ i j : ι,
      i ≤ j → ∀ s : Set Ω, MeasurableSet[ℱ i] s → ∫ ω in s, f i ω ∂μ ≤ ∫ ω in s, f j ω ∂μ) :
    Submartingale f ℱ μ := by
  refine' ⟨hadp, fun i j hij => _, hint⟩
  suffices f i ≤ᵐ[μ.trim (ℱ.le i)] μ[f j|ℱ i] by exact ae_le_of_ae_le_trim this
  suffices 0 ≤ᵐ[μ.trim (ℱ.le i)] μ[f j|ℱ i] - f i by
    filter_upwards [this] with x hx
    

Proof state:
case h
Ω : Type u_1
E : Type u_2
ι : Type u_3
inst✝⁴ : Preorder ι
m0 : MeasurableSpace Ω
μ : Measure Ω
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
f✝ g : ι → Ω → E
ℱ : Filtration ι m0
inst✝ : IsFiniteMeasure μ
f : ι → Ω → ℝ
hadp : Adapted ℱ f
hint : ∀ (i : ι), Integrable (f i)
hf : ∀ (i j : ι), i ≤ j → ∀ (s : Set Ω), MeasurableSet s → ∫ (ω : Ω) in s, f i ω ∂μ ≤ ∫ (ω : Ω) in s, f j ω ∂μ
i j : ι
hij : i ≤ j
this : 0 ≤ᵐ[Measure.trim μ (_ : ↑ℱ i ≤ m0)] μ[f j|↑ℱ i] - f i
x : Ω
hx : OfNat.ofNat 0 x ≤ (μ[f j|↑ℱ i] - f i) x
⊢ f i x ≤ (μ[f j|↑ℱ i]) x

Next tactic:
rwa [← sub_nonneg]
theorem submartingale_of_set_integral_le [IsFiniteMeasure μ] {f : ι → Ω → ℝ} (hadp : Adapted ℱ f)
    (hint : ∀ i, Integrable (f i) μ) (hf : ∀ i j : ι,
      i ≤ j → ∀ s : Set Ω, MeasurableSet[ℱ i] s → ∫ ω in s, f i ω ∂μ ≤ ∫ ω in s, f j ω ∂μ) :
    Submartingale f ℱ μ := by
  refine' ⟨hadp, fun i j hij => _, hint⟩
  suffices f i ≤ᵐ[μ.trim (ℱ.le i)] μ[f j|ℱ i] by exact ae_le_of_ae_le_trim this
  suffices 0 ≤ᵐ[μ.trim (ℱ.le i)] μ[f j|ℱ i] - f i by
    filter_upwards [this] with x hx
    rwa [← sub_nonneg]
  

Proof state:
Ω : Type u_1
E : Type u_2
ι : Type u_3
inst✝⁴ : Preorder ι
m0 : MeasurableSpace Ω
μ : Measure Ω
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
f✝ g : ι → Ω → E
ℱ : Filtration ι m0
inst✝ : IsFiniteMeasure μ
f : ι → Ω → ℝ
hadp : Adapted ℱ f
hint : ∀ (i : ι), Integrable (f i)
hf : ∀ (i j : ι), i ≤ j → ∀ (s : Set Ω), MeasurableSet s → ∫ (ω : Ω) in s, f i ω ∂μ ≤ ∫ (ω : Ω) in s, f j ω ∂μ
i j : ι
hij : i ≤ j
⊢ 0 ≤ᵐ[Measure.trim μ (_ : ↑ℱ i ≤ m0)] μ[f j|↑ℱ i] - f i

Next tactic:
refine' ae_nonneg_of_forall_set_integral_nonneg
    ((integrable_condexp.sub (hint i)).trim _ (stronglyMeasurable_condexp.sub <| hadp i))
      fun s hs _ => _
theorem submartingale_of_set_integral_le [IsFiniteMeasure μ] {f : ι → Ω → ℝ} (hadp : Adapted ℱ f)
    (hint : ∀ i, Integrable (f i) μ) (hf : ∀ i j : ι,
      i ≤ j → ∀ s : Set Ω, MeasurableSet[ℱ i] s → ∫ ω in s, f i ω ∂μ ≤ ∫ ω in s, f j ω ∂μ) :
    Submartingale f ℱ μ := by
  refine' ⟨hadp, fun i j hij => _, hint⟩
  suffices f i ≤ᵐ[μ.trim (ℱ.le i)] μ[f j|ℱ i] by exact ae_le_of_ae_le_trim this
  suffices 0 ≤ᵐ[μ.trim (ℱ.le i)] μ[f j|ℱ i] - f i by
    filter_upwards [this] with x hx
    rwa [← sub_nonneg]
  refine' ae_nonneg_of_forall_set_integral_nonneg
    ((integrable_condexp.sub (hint i)).trim _ (stronglyMeasurable_condexp.sub <| hadp i))
      fun s hs _ => _
  

Proof state:
Ω : Type u_1
E : Type u_2
ι : Type u_3
inst✝⁴ : Preorder ι
m0 : MeasurableSpace Ω
μ : Measure Ω
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
f✝ g : ι → Ω → E
ℱ : Filtration ι m0
inst✝ : IsFiniteMeasure μ
f : ι → Ω → ℝ
hadp : Adapted ℱ f
hint : ∀ (i : ι), Integrable (f i)
hf : ∀ (i j : ι), i ≤ j → ∀ (s : Set Ω), MeasurableSet s → ∫ (ω : Ω) in s, f i ω ∂μ ≤ ∫ (ω : Ω) in s, f j ω ∂μ
i j : ι
hij : i ≤ j
s : Set Ω
hs : MeasurableSet s
x✝ : ↑↑(Measure.trim μ (_ : ↑ℱ i ≤ m0)) s < ⊤
⊢ 0 ≤ ∫ (x : Ω) in s, (μ[f j|↑ℱ i] - f i) x ∂Measure.trim μ (_ : ↑ℱ i ≤ m0)

Next tactic:
specialize hf i j hij s hs
theorem submartingale_of_set_integral_le [IsFiniteMeasure μ] {f : ι → Ω → ℝ} (hadp : Adapted ℱ f)
    (hint : ∀ i, Integrable (f i) μ) (hf : ∀ i j : ι,
      i ≤ j → ∀ s : Set Ω, MeasurableSet[ℱ i] s → ∫ ω in s, f i ω ∂μ ≤ ∫ ω in s, f j ω ∂μ) :
    Submartingale f ℱ μ := by
  refine' ⟨hadp, fun i j hij => _, hint⟩
  suffices f i ≤ᵐ[μ.trim (ℱ.le i)] μ[f j|ℱ i] by exact ae_le_of_ae_le_trim this
  suffices 0 ≤ᵐ[μ.trim (ℱ.le i)] μ[f j|ℱ i] - f i by
    filter_upwards [this] with x hx
    rwa [← sub_nonneg]
  refine' ae_nonneg_of_forall_set_integral_nonneg
    ((integrable_condexp.sub (hint i)).trim _ (stronglyMeasurable_condexp.sub <| hadp i))
      fun s hs _ => _
  specialize hf i j hij s hs
  

Proof state:
Ω : Type u_1
E : Type u_2
ι : Type u_3
inst✝⁴ : Preorder ι
m0 : MeasurableSpace Ω
μ : Measure Ω
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
f✝ g : ι → Ω → E
ℱ : Filtration ι m0
inst✝ : IsFiniteMeasure μ
f : ι → Ω → ℝ
hadp : Adapted ℱ f
hint : ∀ (i : ι), Integrable (f i)
i j : ι
hij : i ≤ j
s : Set Ω
hs : MeasurableSet s
x✝ : ↑↑(Measure.trim μ (_ : ↑ℱ i ≤ m0)) s < ⊤
hf : ∫ (ω : Ω) in s, f i ω ∂μ ≤ ∫ (ω : Ω) in s, f j ω ∂μ
⊢ 0 ≤ ∫ (x : Ω) in s, (μ[f j|↑ℱ i] - f i) x ∂Measure.trim μ (_ : ↑ℱ i ≤ m0)

Next tactic:
rwa [← set_integral_trim _ (stronglyMeasurable_condexp.sub <| hadp i) hs,
    integral_sub' integrable_condexp.integrableOn (hint i).integrableOn, sub_nonneg,
    set_integral_condexp (ℱ.le i) (hint j) hs]
theorem submartingale_of_condexp_sub_nonneg [IsFiniteMeasure μ] {f : ι → Ω → ℝ} (hadp : Adapted ℱ f)
    (hint : ∀ i, Integrable (f i) μ) (hf : ∀ i j, i ≤ j → 0 ≤ᵐ[μ] μ[f j - f i|ℱ i]) :
    Submartingale f ℱ μ := by
  

Proof state:
Ω : Type u_1
E : Type u_2
ι : Type u_3
inst✝⁴ : Preorder ι
m0 : MeasurableSpace Ω
μ : Measure Ω
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
f✝ g : ι → Ω → E
ℱ : Filtration ι m0
inst✝ : IsFiniteMeasure μ
f : ι → Ω → ℝ
hadp : Adapted ℱ f
hint : ∀ (i : ι), Integrable (f i)
hf : ∀ (i j : ι), i ≤ j → 0 ≤ᵐ[μ] μ[f j - f i|↑ℱ i]
⊢ Submartingale f ℱ μ

Next tactic:
refine' ⟨hadp, fun i j hij => _, hint⟩
theorem submartingale_of_condexp_sub_nonneg [IsFiniteMeasure μ] {f : ι → Ω → ℝ} (hadp : Adapted ℱ f)
    (hint : ∀ i, Integrable (f i) μ) (hf : ∀ i j, i ≤ j → 0 ≤ᵐ[μ] μ[f j - f i|ℱ i]) :
    Submartingale f ℱ μ := by
  refine' ⟨hadp, fun i j hij => _, hint⟩
  

Proof state:
Ω : Type u_1
E : Type u_2
ι : Type u_3
inst✝⁴ : Preorder ι
m0 : MeasurableSpace Ω
μ : Measure Ω
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
f✝ g : ι → Ω → E
ℱ : Filtration ι m0
inst✝ : IsFiniteMeasure μ
f : ι → Ω → ℝ
hadp : Adapted ℱ f
hint : ∀ (i : ι), Integrable (f i)
hf : ∀ (i j : ι), i ≤ j → 0 ≤ᵐ[μ] μ[f j - f i|↑ℱ i]
i j : ι
hij : i ≤ j
⊢ f i ≤ᵐ[μ] μ[f j|↑ℱ i]

Next tactic:
rw [← condexp_of_stronglyMeasurable (ℱ.le _) (hadp _) (hint _), ← eventually_sub_nonneg]
theorem submartingale_of_condexp_sub_nonneg [IsFiniteMeasure μ] {f : ι → Ω → ℝ} (hadp : Adapted ℱ f)
    (hint : ∀ i, Integrable (f i) μ) (hf : ∀ i j, i ≤ j → 0 ≤ᵐ[μ] μ[f j - f i|ℱ i]) :
    Submartingale f ℱ μ := by
  refine' ⟨hadp, fun i j hij => _, hint⟩
  rw [← condexp_of_stronglyMeasurable (ℱ.le _) (hadp _) (hint _), ← eventually_sub_nonneg]
  

Proof state:
Ω : Type u_1
E : Type u_2
ι : Type u_3
inst✝⁴ : Preorder ι
m0 : MeasurableSpace Ω
μ : Measure Ω
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
f✝ g : ι → Ω → E
ℱ : Filtration ι m0
inst✝ : IsFiniteMeasure μ
f : ι → Ω → ℝ
hadp : Adapted ℱ f
hint : ∀ (i : ι), Integrable (f i)
hf : ∀ (i j : ι), i ≤ j → 0 ≤ᵐ[μ] μ[f j - f i|↑ℱ i]
i j : ι
hij : i ≤ j
⊢ 0 ≤ᵐ[μ] μ[f j|↑ℱ i] - μ[f i|↑ℱ i]

Next tactic:
exact EventuallyLE.trans (hf i j hij) (condexp_sub (hint _) (hint _)).le
theorem Submartingale.condexp_sub_nonneg {f : ι → Ω → ℝ} (hf : Submartingale f ℱ μ) {i j : ι}
    (hij : i ≤ j) : 0 ≤ᵐ[μ] μ[f j - f i|ℱ i] := by
  

Proof state:
Ω : Type u_1
E : Type u_2
ι : Type u_3
inst✝³ : Preorder ι
m0 : MeasurableSpace Ω
μ : Measure Ω
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
f✝ g : ι → Ω → E
ℱ : Filtration ι m0
f : ι → Ω → ℝ
hf : Submartingale f ℱ μ
i j : ι
hij : i ≤ j
⊢ 0 ≤ᵐ[μ] μ[f j - f i|↑ℱ i]

Next tactic:
by_cases h : SigmaFinite (μ.trim (ℱ.le i))
theorem Submartingale.condexp_sub_nonneg {f : ι → Ω → ℝ} (hf : Submartingale f ℱ μ) {i j : ι}
    (hij : i ≤ j) : 0 ≤ᵐ[μ] μ[f j - f i|ℱ i] := by
  by_cases h : SigmaFinite (μ.trim (ℱ.le i))
  

Proof state:
case pos
Ω : Type u_1
E : Type u_2
ι : Type u_3
inst✝³ : Preorder ι
m0 : MeasurableSpace Ω
μ : Measure Ω
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
f✝ g : ι → Ω → E
ℱ : Filtration ι m0
f : ι → Ω → ℝ
hf : Submartingale f ℱ μ
i j : ι
hij : i ≤ j
h : SigmaFinite (Measure.trim μ (_ : ↑ℱ i ≤ m0))
⊢ 0 ≤ᵐ[μ] μ[f j - f i|↑ℱ i]
case neg
Ω : Type u_1
E : Type u_2
ι : Type u_3
inst✝³ : Preorder ι
m0 : MeasurableSpace Ω
μ : Measure Ω
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
f✝ g : ι → Ω → E
ℱ : Filtration ι m0
f : ι → Ω → ℝ
hf : Submartingale f ℱ μ
i j : ι
hij : i ≤ j
h : ¬SigmaFinite (Measure.trim μ (_ : ↑ℱ i ≤ m0))
⊢ 0 ≤ᵐ[μ] μ[f j - f i|↑ℱ i]

Next tactic:
swap
theorem Submartingale.condexp_sub_nonneg {f : ι → Ω → ℝ} (hf : Submartingale f ℱ μ) {i j : ι}
    (hij : i ≤ j) : 0 ≤ᵐ[μ] μ[f j - f i|ℱ i] := by
  by_cases h : SigmaFinite (μ.trim (ℱ.le i))
  swap; · 

Proof state:
case neg
Ω : Type u_1
E : Type u_2
ι : Type u_3
inst✝³ : Preorder ι
m0 : MeasurableSpace Ω
μ : Measure Ω
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
f✝ g : ι → Ω → E
ℱ : Filtration ι m0
f : ι → Ω → ℝ
hf : Submartingale f ℱ μ
i j : ι
hij : i ≤ j
h : ¬SigmaFinite (Measure.trim μ (_ : ↑ℱ i ≤ m0))
⊢ 0 ≤ᵐ[μ] μ[f j - f i|↑ℱ i]

Next tactic:
rw [condexp_of_not_sigmaFinite (ℱ.le i) h]
theorem Submartingale.condexp_sub_nonneg {f : ι → Ω → ℝ} (hf : Submartingale f ℱ μ) {i j : ι}
    (hij : i ≤ j) : 0 ≤ᵐ[μ] μ[f j - f i|ℱ i] := by
  by_cases h : SigmaFinite (μ.trim (ℱ.le i))
  swap; · rw [condexp_of_not_sigmaFinite (ℱ.le i) h]
  

Proof state:
case pos
Ω : Type u_1
E : Type u_2
ι : Type u_3
inst✝³ : Preorder ι
m0 : MeasurableSpace Ω
μ : Measure Ω
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
f✝ g : ι → Ω → E
ℱ : Filtration ι m0
f : ι → Ω → ℝ
hf : Submartingale f ℱ μ
i j : ι
hij : i ≤ j
h : SigmaFinite (Measure.trim μ (_ : ↑ℱ i ≤ m0))
⊢ 0 ≤ᵐ[μ] μ[f j - f i|↑ℱ i]

Next tactic:
refine' EventuallyLE.trans _ (condexp_sub (hf.integrable _) (hf.integrable _)).symm.le
theorem Submartingale.condexp_sub_nonneg {f : ι → Ω → ℝ} (hf : Submartingale f ℱ μ) {i j : ι}
    (hij : i ≤ j) : 0 ≤ᵐ[μ] μ[f j - f i|ℱ i] := by
  by_cases h : SigmaFinite (μ.trim (ℱ.le i))
  swap; · rw [condexp_of_not_sigmaFinite (ℱ.le i) h]
  refine' EventuallyLE.trans _ (condexp_sub (hf.integrable _) (hf.integrable _)).symm.le
  

Proof state:
case pos
Ω : Type u_1
E : Type u_2
ι : Type u_3
inst✝³ : Preorder ι
m0 : MeasurableSpace Ω
μ : Measure Ω
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
f✝ g : ι → Ω → E
ℱ : Filtration ι m0
f : ι → Ω → ℝ
hf : Submartingale f ℱ μ
i j : ι
hij : i ≤ j
h : SigmaFinite (Measure.trim μ (_ : ↑ℱ i ≤ m0))
⊢ 0 ≤ᵐ[μ] μ[f j|↑ℱ i] - μ[f i|↑ℱ i]

Next tactic:
rw [eventually_sub_nonneg,
    condexp_of_stronglyMeasurable (ℱ.le _) (hf.adapted _) (hf.integrable _)]
theorem Submartingale.condexp_sub_nonneg {f : ι → Ω → ℝ} (hf : Submartingale f ℱ μ) {i j : ι}
    (hij : i ≤ j) : 0 ≤ᵐ[μ] μ[f j - f i|ℱ i] := by
  by_cases h : SigmaFinite (μ.trim (ℱ.le i))
  swap; · rw [condexp_of_not_sigmaFinite (ℱ.le i) h]
  refine' EventuallyLE.trans _ (condexp_sub (hf.integrable _) (hf.integrable _)).symm.le
  rw [eventually_sub_nonneg,
    condexp_of_stronglyMeasurable (ℱ.le _) (hf.adapted _) (hf.integrable _)]
  · 

Proof state:
case pos
Ω : Type u_1
E : Type u_2
ι : Type u_3
inst✝³ : Preorder ι
m0 : MeasurableSpace Ω
μ : Measure Ω
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
f✝ g : ι → Ω → E
ℱ : Filtration ι m0
f : ι → Ω → ℝ
hf : Submartingale f ℱ μ
i j : ι
hij : i ≤ j
h : SigmaFinite (Measure.trim μ (_ : ↑ℱ i ≤ m0))
⊢ f i ≤ᵐ[μ] μ[f j|↑ℱ i]

Next tactic:
exact hf.2.1 i j hij
theorem sub_submartingale [Preorder E] [CovariantClass E E (· + ·) (· ≤ ·)]
    (hf : Supermartingale f ℱ μ) (hg : Submartingale g ℱ μ) : Supermartingale (f - g) ℱ μ := by
  

Proof state:
Ω : Type u_1
E : Type u_2
ι : Type u_3
inst✝⁵ : Preorder ι
m0 : MeasurableSpace Ω
μ : Measure Ω
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : CompleteSpace E
f g : ι → Ω → E
ℱ : Filtration ι m0
inst✝¹ : Preorder E
inst✝ : CovariantClass E E (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
hf : Supermartingale f ℱ μ
hg : Submartingale g ℱ μ
⊢ Supermartingale (f - g) ℱ μ

Next tactic:
rw [sub_eq_add_neg]
theorem sub_submartingale [Preorder E] [CovariantClass E E (· + ·) (· ≤ ·)]
    (hf : Supermartingale f ℱ μ) (hg : Submartingale g ℱ μ) : Supermartingale (f - g) ℱ μ := by
  rw [sub_eq_add_neg]; 

Proof state:
Ω : Type u_1
E : Type u_2
ι : Type u_3
inst✝⁵ : Preorder ι
m0 : MeasurableSpace Ω
μ : Measure Ω
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : CompleteSpace E
f g : ι → Ω → E
ℱ : Filtration ι m0
inst✝¹ : Preorder E
inst✝ : CovariantClass E E (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
hf : Supermartingale f ℱ μ
hg : Submartingale g ℱ μ
⊢ Supermartingale (f + -g) ℱ μ

Next tactic:
exact hf.add hg.neg
theorem smul_nonneg {f : ι → Ω → F} {c : ℝ} (hc : 0 ≤ c) (hf : Supermartingale f ℱ μ) :
    Supermartingale (c • f) ℱ μ := by
  

Proof state:
Ω : Type u_1
E : Type u_2
ι : Type u_3
inst✝⁷ : Preorder ι
m0 : MeasurableSpace Ω
μ : Measure Ω
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedSpace ℝ E
inst✝⁴ : CompleteSpace E
f✝ g : ι → Ω → E
ℱ : Filtration ι m0
F : Type u_4
inst✝³ : NormedLatticeAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : CompleteSpace F
inst✝ : OrderedSMul ℝ F
f : ι → Ω → F
c : ℝ
hc : 0 ≤ c
hf : Supermartingale f ℱ μ
⊢ Supermartingale (c • f) ℱ μ

Next tactic:
refine' ⟨hf.1.smul c, fun i j hij => _, fun i => (hf.2.2 i).smul c⟩
theorem smul_nonneg {f : ι → Ω → F} {c : ℝ} (hc : 0 ≤ c) (hf : Supermartingale f ℱ μ) :
    Supermartingale (c • f) ℱ μ := by
  refine' ⟨hf.1.smul c, fun i j hij => _, fun i => (hf.2.2 i).smul c⟩
  

Proof state:
Ω : Type u_1
E : Type u_2
ι : Type u_3
inst✝⁷ : Preorder ι
m0 : MeasurableSpace Ω
μ : Measure Ω
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedSpace ℝ E
inst✝⁴ : CompleteSpace E
f✝ g : ι → Ω → E
ℱ : Filtration ι m0
F : Type u_4
inst✝³ : NormedLatticeAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : CompleteSpace F
inst✝ : OrderedSMul ℝ F
f : ι → Ω → F
c : ℝ
hc : 0 ≤ c
hf : Supermartingale f ℱ μ
i j : ι
hij : i ≤ j
⊢ μ[(c • f) j|↑ℱ i] ≤ᵐ[μ] (c • f) i

Next tactic:
refine' (condexp_smul c (f j)).le.trans _
theorem smul_nonneg {f : ι → Ω → F} {c : ℝ} (hc : 0 ≤ c) (hf : Supermartingale f ℱ μ) :
    Supermartingale (c • f) ℱ μ := by
  refine' ⟨hf.1.smul c, fun i j hij => _, fun i => (hf.2.2 i).smul c⟩
  refine' (condexp_smul c (f j)).le.trans _
  

Proof state:
Ω : Type u_1
E : Type u_2
ι : Type u_3
inst✝⁷ : Preorder ι
m0 : MeasurableSpace Ω
μ : Measure Ω
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedSpace ℝ E
inst✝⁴ : CompleteSpace E
f✝ g : ι → Ω → E
ℱ : Filtration ι m0
F : Type u_4
inst✝³ : NormedLatticeAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : CompleteSpace F
inst✝ : OrderedSMul ℝ F
f : ι → Ω → F
c : ℝ
hc : 0 ≤ c
hf : Supermartingale f ℱ μ
i j : ι
hij : i ≤ j
⊢ c • μ[f j|↑ℱ i] ≤ᵐ[μ] (c • f) i

Next tactic:
filter_upwards [hf.2.1 i j hij] with _ hle
theorem smul_nonneg {f : ι → Ω → F} {c : ℝ} (hc : 0 ≤ c) (hf : Supermartingale f ℱ μ) :
    Supermartingale (c • f) ℱ μ := by
  refine' ⟨hf.1.smul c, fun i j hij => _, fun i => (hf.2.2 i).smul c⟩
  refine' (condexp_smul c (f j)).le.trans _
  filter_upwards [hf.2.1 i j hij] with _ hle
  

Proof state:
case h
Ω : Type u_1
E : Type u_2
ι : Type u_3
inst✝⁷ : Preorder ι
m0 : MeasurableSpace Ω
μ : Measure Ω
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedSpace ℝ E
inst✝⁴ : CompleteSpace E
f✝ g : ι → Ω → E
ℱ : Filtration ι m0
F : Type u_4
inst✝³ : NormedLatticeAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : CompleteSpace F
inst✝ : OrderedSMul ℝ F
f : ι → Ω → F
c : ℝ
hc : 0 ≤ c
hf : Supermartingale f ℱ μ
i j : ι
hij : i ≤ j
a✝ : Ω
hle : (μ[f j|↑ℱ i]) a✝ ≤ f i a✝
⊢ (c • μ[f j|↑ℱ i]) a✝ ≤ (c • f) i a✝

Next tactic:
simp_rw [Pi.smul_apply]
theorem smul_nonneg {f : ι → Ω → F} {c : ℝ} (hc : 0 ≤ c) (hf : Supermartingale f ℱ μ) :
    Supermartingale (c • f) ℱ μ := by
  refine' ⟨hf.1.smul c, fun i j hij => _, fun i => (hf.2.2 i).smul c⟩
  refine' (condexp_smul c (f j)).le.trans _
  filter_upwards [hf.2.1 i j hij] with _ hle
  simp_rw [Pi.smul_apply]
  

Proof state:
case h
Ω : Type u_1
E : Type u_2
ι : Type u_3
inst✝⁷ : Preorder ι
m0 : MeasurableSpace Ω
μ : Measure Ω
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedSpace ℝ E
inst✝⁴ : CompleteSpace E
f✝ g : ι → Ω → E
ℱ : Filtration ι m0
F : Type u_4
inst✝³ : NormedLatticeAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : CompleteSpace F
inst✝ : OrderedSMul ℝ F
f : ι → Ω → F
c : ℝ
hc : 0 ≤ c
hf : Supermartingale f ℱ μ
i j : ι
hij : i ≤ j
a✝ : Ω
hle : (μ[f j|↑ℱ i]) a✝ ≤ f i a✝
⊢ c • (μ[f j|↑ℱ i]) a✝ ≤ c • f i a✝

Next tactic:
exact smul_le_smul_of_nonneg hle hc
theorem smul_nonpos {f : ι → Ω → F} {c : ℝ} (hc : c ≤ 0) (hf : Supermartingale f ℱ μ) :
    Submartingale (c • f) ℱ μ := by
  

Proof state:
Ω : Type u_1
E : Type u_2
ι : Type u_3
inst✝⁷ : Preorder ι
m0 : MeasurableSpace Ω
μ : Measure Ω
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedSpace ℝ E
inst✝⁴ : CompleteSpace E
f✝ g : ι → Ω → E
ℱ : Filtration ι m0
F : Type u_4
inst✝³ : NormedLatticeAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : CompleteSpace F
inst✝ : OrderedSMul ℝ F
f : ι → Ω → F
c : ℝ
hc : c ≤ 0
hf : Supermartingale f ℱ μ
⊢ Submartingale (c • f) ℱ μ

Next tactic:
rw [← neg_neg c, (by ext (i x); simp : - -c • f = -(-c • f))]
theorem smul_nonpos {f : ι → Ω → F} {c : ℝ} (hc : c ≤ 0) (hf : Supermartingale f ℱ μ) :
    Submartingale (c • f) ℱ μ := by
  rw [← neg_neg c, (by 

Proof state:
Ω : Type u_1
E : Type u_2
ι : Type u_3
inst✝⁷ : Preorder ι
m0 : MeasurableSpace Ω
μ : Measure Ω
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedSpace ℝ E
inst✝⁴ : CompleteSpace E
f✝ g : ι → Ω → E
ℱ : Filtration ι m0
F : Type u_4
inst✝³ : NormedLatticeAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : CompleteSpace F
inst✝ : OrderedSMul ℝ F
f : ι → Ω → F
c : ℝ
hc : c ≤ 0
hf : Supermartingale f ℱ μ
⊢ - -c • f = -(-c • f)

Next tactic:
ext (i x)
theorem smul_nonpos {f : ι → Ω → F} {c : ℝ} (hc : c ≤ 0) (hf : Supermartingale f ℱ μ) :
    Submartingale (c • f) ℱ μ := by
  rw [← neg_neg c, (by ext (i x); 

Proof state:
case h.h
Ω : Type u_1
E : Type u_2
ι : Type u_3
inst✝⁷ : Preorder ι
m0 : MeasurableSpace Ω
μ : Measure Ω
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedSpace ℝ E
inst✝⁴ : CompleteSpace E
f✝ g : ι → Ω → E
ℱ : Filtration ι m0
F : Type u_4
inst✝³ : NormedLatticeAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : CompleteSpace F
inst✝ : OrderedSMul ℝ F
f : ι → Ω → F
c : ℝ
hc : c ≤ 0
hf : Supermartingale f ℱ μ
i : ι
x : Ω
⊢ (- -c • f) i x = (-(-c • f)) i x

Next tactic:
simp
theorem smul_nonpos {f : ι → Ω → F} {c : ℝ} (hc : c ≤ 0) (hf : Supermartingale f ℱ μ) :
    Submartingale (c • f) ℱ μ := by
  rw [← neg_neg c, (by ext (i x); simp : - -c • f = -(-c • f))]
  

Proof state:
Ω : Type u_1
E : Type u_2
ι : Type u_3
inst✝⁷ : Preorder ι
m0 : MeasurableSpace Ω
μ : Measure Ω
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedSpace ℝ E
inst✝⁴ : CompleteSpace E
f✝ g : ι → Ω → E
ℱ : Filtration ι m0
F : Type u_4
inst✝³ : NormedLatticeAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : CompleteSpace F
inst✝ : OrderedSMul ℝ F
f : ι → Ω → F
c : ℝ
hc : c ≤ 0
hf : Supermartingale f ℱ μ
⊢ Submartingale (-(-c • f)) ℱ μ

Next tactic:
exact (hf.smul_nonneg <| neg_nonneg.2 hc).neg
theorem smul_nonneg {f : ι → Ω → F} {c : ℝ} (hc : 0 ≤ c) (hf : Submartingale f ℱ μ) :
    Submartingale (c • f) ℱ μ := by
  

Proof state:
Ω : Type u_1
E : Type u_2
ι : Type u_3
inst✝⁷ : Preorder ι
m0 : MeasurableSpace Ω
μ : Measure Ω
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedSpace ℝ E
inst✝⁴ : CompleteSpace E
f✝ g : ι → Ω → E
ℱ : Filtration ι m0
F : Type u_4
inst✝³ : NormedLatticeAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : CompleteSpace F
inst✝ : OrderedSMul ℝ F
f : ι → Ω → F
c : ℝ
hc : 0 ≤ c
hf : Submartingale f ℱ μ
⊢ Submartingale (c • f) ℱ μ

Next tactic:
rw [← neg_neg c, (by ext (i x); simp : - -c • f = -(c • -f))]