-- Mathlib/Probability/Martingale/Basic.lean
theorem Submartingale.sum_mul_sub [IsFiniteMeasure μ] {R : ℝ} {ξ f : ℕ → Ω → ℝ}
    (hf : Submartingale f 𝒢 μ) (hξ : Adapted 𝒢 ξ) (hbdd : ∀ n ω, ξ n ω ≤ R)
    (hnonneg : ∀ n ω, 0 ≤ ξ n ω) :
    Submartingale (fun n => ∑ k ∈ Finset.range n, ξ k * (f (k + 1) - f k)) 𝒢 μ

Proof state:
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
inst✝ : IsFiniteMeasure μ
R : ℝ
ξ f : ℕ → Ω → ℝ
hf : Submartingale f 𝒢 μ
hξ : Adapted 𝒢 ξ
hbdd : ∀ (n : ℕ) (ω : Ω), ξ n ω ≤ R
hnonneg : ∀ (n : ℕ) (ω : Ω), 0 ≤ ξ n ω
hξbdd : ∀ (i : ℕ), ∃ C, ∀ (ω : Ω), |ξ i ω| ≤ C
⊢ Submartingale (fun n => ∑ k ∈ Finset.range n, ξ k * (f (k + 1) - f k)) 𝒢 μ

Tactic:
have hint : ∀ m, Integrable (∑ k ∈ Finset.range m, ξ k * (f (k + 1) - f k)) μ := fun m =>
  integrable_finset_sum' _ fun i _ => Integrable.bdd_mul ((hf.integrable _).sub (hf.integrable _))
    hξ.stronglyMeasurable.aestronglyMeasurable (hξbdd _)

Result:
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
inst✝ : IsFiniteMeasure μ
R : ℝ
ξ f : ℕ → Ω → ℝ
hf : Submartingale f 𝒢 μ
hξ : Adapted 𝒢 ξ
hbdd : ∀ (n : ℕ) (ω : Ω), ξ n ω ≤ R
hnonneg : ∀ (n : ℕ) (ω : Ω), 0 ≤ ξ n ω
hξbdd : ∀ (i : ℕ), ∃ C, ∀ (ω : Ω), |ξ i ω| ≤ C
hint : ∀ (m : ℕ), Integrable (∑ k ∈ Finset.range m, ξ k * (f (k + 1) - f k)) μ
⊢ Submartingale (fun n => ∑ k ∈ Finset.range n, ξ k * (f (k + 1) - f k)) 𝒢 μ

Proof state:
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
inst✝ : IsFiniteMeasure μ
R : ℝ
ξ f : ℕ → Ω → ℝ
hf : Submartingale f 𝒢 μ
hξ : Adapted 𝒢 ξ
hbdd : ∀ (n : ℕ) (ω : Ω), ξ n ω ≤ R
hnonneg : ∀ (n : ℕ) (ω : Ω), 0 ≤ ξ n ω
hξbdd : ∀ (i : ℕ), ∃ C, ∀ (ω : Ω), |ξ i ω| ≤ C
hint : ∀ (m : ℕ), Integrable (∑ k ∈ Finset.range m, ξ k * (f (k + 1) - f k)) μ
m : ℕ
⊢ StronglyMeasurable ((fun n => ∑ k ∈ Finset.range n, ξ k * (f (k + 1) - f k)) m)

Tactic:
refine Finset.stronglyMeasurable_sum' _ fun i hi => ?_

Result:
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
inst✝ : IsFiniteMeasure μ
R : ℝ
ξ f : ℕ → Ω → ℝ
hf : Submartingale f 𝒢 μ
hξ : Adapted 𝒢 ξ
hbdd : ∀ (n : ℕ) (ω : Ω), ξ n ω ≤ R
hnonneg : ∀ (n : ℕ) (ω : Ω), 0 ≤ ξ n ω
hξbdd : ∀ (i : ℕ), ∃ C, ∀ (ω : Ω), |ξ i ω| ≤ C
hint : ∀ (m : ℕ), Integrable (∑ k ∈ Finset.range m, ξ k * (f (k + 1) - f k)) μ
m i : ℕ
hi : i ∈ Finset.range m
⊢ StronglyMeasurable (ξ i * (f (i + 1) - f i))

Proof state:
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
inst✝ : IsFiniteMeasure μ
R : ℝ
ξ f : ℕ → Ω → ℝ
hf : Submartingale f 𝒢 μ
hξ : Adapted 𝒢 ξ
hbdd : ∀ (n : ℕ) (ω : Ω), ξ n ω ≤ R
hnonneg : ∀ (n : ℕ) (ω : Ω), 0 ≤ ξ n ω
hξbdd : ∀ (i : ℕ), ∃ C, ∀ (ω : Ω), |ξ i ω| ≤ C
hint : ∀ (m : ℕ), Integrable (∑ k ∈ Finset.range m, ξ k * (f (k + 1) - f k)) μ
hadp : Adapted 𝒢 fun n => ∑ k ∈ Finset.range n, ξ k * (f (k + 1) - f k)
i : ℕ
⊢ 0 ≤ᶠ[ae μ] μ[∑ k ∈ Finset.range (i + 1), ξ k * (f (k + 1) - f k) - ∑ k ∈ Finset.range i, ξ k * (f (k + 1) - f k)|↑𝒢 i]

Tactic:
simp only [← Finset.sum_Ico_eq_sub _ (Nat.le_succ _), Finset.sum_apply, Pi.mul_apply,
  Pi.sub_apply, Nat.Ico_succ_singleton, Finset.sum_singleton]

Result:
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
inst✝ : IsFiniteMeasure μ
R : ℝ
ξ f : ℕ → Ω → ℝ
hf : Submartingale f 𝒢 μ
hξ : Adapted 𝒢 ξ
hbdd : ∀ (n : ℕ) (ω : Ω), ξ n ω ≤ R
hnonneg : ∀ (n : ℕ) (ω : Ω), 0 ≤ ξ n ω
hξbdd : ∀ (i : ℕ), ∃ C, ∀ (ω : Ω), |ξ i ω| ≤ C
hint : ∀ (m : ℕ), Integrable (∑ k ∈ Finset.range m, ξ k * (f (k + 1) - f k)) μ
hadp : Adapted 𝒢 fun n => ∑ k ∈ Finset.range n, ξ k * (f (k + 1) - f k)
i : ℕ
⊢ 0 ≤ᶠ[ae μ] μ[ξ i * (f (i + 1) - f i)|↑𝒢 i]