l3lab/ntp-mathlib huggingface dataset:
theorem stoppedProcess_eq_of_mem_finset [LinearOrder ι] [AddCommMonoid E] {s : Finset ι} (n : ι)
    (hbdd : ∀ ω, τ ω < n → τ ω ∈ s) : stoppedProcess u τ n = Set.indicator {a | n ≤ τ a} (u n) +
      ∑ i in s.filter (· < n), Set.indicator {ω | τ ω = i} (u i) := by
  ext ω
  rw [Pi.add_apply, Finset.sum_apply]
  rcases le_or_lt n (τ ω) with h | h
  · rw [stoppedProcess_eq_of_le h, Set.indicator_of_mem, Finset.sum_eq_zero, add_zero]
    · intro m hm
      refine' Set.indicator_of_not_mem _ _
      rw [Finset.mem_filter] at hm
      

Proof state:
case h.inl
Ω : Type u_1
β : Type u_2
ι : Type u_3
m✝ : MeasurableSpace Ω
μ : Measure Ω
τ σ : Ω → ι
E : Type u_4
p : ℝ≥0∞
u : ι → Ω → E
inst✝¹ : LinearOrder ι
inst✝ : AddCommMonoid E
s : Finset ι
n : ι
hbdd : ∀ (ω : Ω), τ ω < n → τ ω ∈ s
ω : Ω
h : n ≤ τ ω
m : ι
hm : m ∈ s ∧ m < n
⊢ ω ∉ {ω | τ ω = m}

Next tactic:
exact (hm.2.trans_le h).ne'
theorem stoppedProcess_eq_of_mem_finset [LinearOrder ι] [AddCommMonoid E] {s : Finset ι} (n : ι)
    (hbdd : ∀ ω, τ ω < n → τ ω ∈ s) : stoppedProcess u τ n = Set.indicator {a | n ≤ τ a} (u n) +
      ∑ i in s.filter (· < n), Set.indicator {ω | τ ω = i} (u i) := by
  ext ω
  rw [Pi.add_apply, Finset.sum_apply]
  rcases le_or_lt n (τ ω) with h | h
  · rw [stoppedProcess_eq_of_le h, Set.indicator_of_mem, Finset.sum_eq_zero, add_zero]
    · intro m hm
      refine' Set.indicator_of_not_mem _ _
      rw [Finset.mem_filter] at hm
      exact (hm.2.trans_le h).ne'
    · 

Proof state:
case h.inl.h
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
μ : Measure Ω
τ σ : Ω → ι
E : Type u_4
p : ℝ≥0∞
u : ι → Ω → E
inst✝¹ : LinearOrder ι
inst✝ : AddCommMonoid E
s : Finset ι
n : ι
hbdd : ∀ (ω : Ω), τ ω < n → τ ω ∈ s
ω : Ω
h : n ≤ τ ω
⊢ ω ∈ {a | n ≤ τ a}

Next tactic:
exact h
theorem stoppedProcess_eq_of_mem_finset [LinearOrder ι] [AddCommMonoid E] {s : Finset ι} (n : ι)
    (hbdd : ∀ ω, τ ω < n → τ ω ∈ s) : stoppedProcess u τ n = Set.indicator {a | n ≤ τ a} (u n) +
      ∑ i in s.filter (· < n), Set.indicator {ω | τ ω = i} (u i) := by
  ext ω
  rw [Pi.add_apply, Finset.sum_apply]
  rcases le_or_lt n (τ ω) with h | h
  · rw [stoppedProcess_eq_of_le h, Set.indicator_of_mem, Finset.sum_eq_zero, add_zero]
    · intro m hm
      refine' Set.indicator_of_not_mem _ _
      rw [Finset.mem_filter] at hm
      exact (hm.2.trans_le h).ne'
    · exact h
  · 

Proof state:
case h.inr
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
μ : Measure Ω
τ σ : Ω → ι
E : Type u_4
p : ℝ≥0∞
u : ι → Ω → E
inst✝¹ : LinearOrder ι
inst✝ : AddCommMonoid E
s : Finset ι
n : ι
hbdd : ∀ (ω : Ω), τ ω < n → τ ω ∈ s
ω : Ω
h : τ ω < n
⊢ stoppedProcess u τ n ω =
    Set.indicator {a | n ≤ τ a} (u n) ω + ∑ c in Finset.filter (fun x => x < n) s, Set.indicator {ω | τ ω = c} (u c) ω

Next tactic:
rw [stoppedProcess_eq_of_ge (le_of_lt h), Finset.sum_eq_single_of_mem (τ ω)]
theorem stoppedProcess_eq_of_mem_finset [LinearOrder ι] [AddCommMonoid E] {s : Finset ι} (n : ι)
    (hbdd : ∀ ω, τ ω < n → τ ω ∈ s) : stoppedProcess u τ n = Set.indicator {a | n ≤ τ a} (u n) +
      ∑ i in s.filter (· < n), Set.indicator {ω | τ ω = i} (u i) := by
  ext ω
  rw [Pi.add_apply, Finset.sum_apply]
  rcases le_or_lt n (τ ω) with h | h
  · rw [stoppedProcess_eq_of_le h, Set.indicator_of_mem, Finset.sum_eq_zero, add_zero]
    · intro m hm
      refine' Set.indicator_of_not_mem _ _
      rw [Finset.mem_filter] at hm
      exact (hm.2.trans_le h).ne'
    · exact h
  · rw [stoppedProcess_eq_of_ge (le_of_lt h), Finset.sum_eq_single_of_mem (τ ω)]
    · 

Proof state:
case h.inr
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
μ : Measure Ω
τ σ : Ω → ι
E : Type u_4
p : ℝ≥0∞
u : ι → Ω → E
inst✝¹ : LinearOrder ι
inst✝ : AddCommMonoid E
s : Finset ι
n : ι
hbdd : ∀ (ω : Ω), τ ω < n → τ ω ∈ s
ω : Ω
h : τ ω < n
⊢ u (τ ω) ω = Set.indicator {a | n ≤ τ a} (u n) ω + Set.indicator {ω_1 | τ ω_1 = τ ω} (u (τ ω)) ω

Next tactic:
rw [Set.indicator_of_not_mem, zero_add, Set.indicator_of_mem]
theorem stoppedProcess_eq_of_mem_finset [LinearOrder ι] [AddCommMonoid E] {s : Finset ι} (n : ι)
    (hbdd : ∀ ω, τ ω < n → τ ω ∈ s) : stoppedProcess u τ n = Set.indicator {a | n ≤ τ a} (u n) +
      ∑ i in s.filter (· < n), Set.indicator {ω | τ ω = i} (u i) := by
  ext ω
  rw [Pi.add_apply, Finset.sum_apply]
  rcases le_or_lt n (τ ω) with h | h
  · rw [stoppedProcess_eq_of_le h, Set.indicator_of_mem, Finset.sum_eq_zero, add_zero]
    · intro m hm
      refine' Set.indicator_of_not_mem _ _
      rw [Finset.mem_filter] at hm
      exact (hm.2.trans_le h).ne'
    · exact h
  · rw [stoppedProcess_eq_of_ge (le_of_lt h), Finset.sum_eq_single_of_mem (τ ω)]
    · rw [Set.indicator_of_not_mem, zero_add, Set.indicator_of_mem]
      · 

Proof state:
case h.inr.h
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
μ : Measure Ω
τ σ : Ω → ι
E : Type u_4
p : ℝ≥0∞
u : ι → Ω → E
inst✝¹ : LinearOrder ι
inst✝ : AddCommMonoid E
s : Finset ι
n : ι
hbdd : ∀ (ω : Ω), τ ω < n → τ ω ∈ s
ω : Ω
h : τ ω < n
⊢ ω ∈ {ω_1 | τ ω_1 = τ ω}

Next tactic:
exact rfl
theorem stoppedProcess_eq_of_mem_finset [LinearOrder ι] [AddCommMonoid E] {s : Finset ι} (n : ι)
    (hbdd : ∀ ω, τ ω < n → τ ω ∈ s) : stoppedProcess u τ n = Set.indicator {a | n ≤ τ a} (u n) +
      ∑ i in s.filter (· < n), Set.indicator {ω | τ ω = i} (u i) := by
  ext ω
  rw [Pi.add_apply, Finset.sum_apply]
  rcases le_or_lt n (τ ω) with h | h
  · rw [stoppedProcess_eq_of_le h, Set.indicator_of_mem, Finset.sum_eq_zero, add_zero]
    · intro m hm
      refine' Set.indicator_of_not_mem _ _
      rw [Finset.mem_filter] at hm
      exact (hm.2.trans_le h).ne'
    · exact h
  · rw [stoppedProcess_eq_of_ge (le_of_lt h), Finset.sum_eq_single_of_mem (τ ω)]
    · rw [Set.indicator_of_not_mem, zero_add, Set.indicator_of_mem]
      · exact rfl
      -- refl does not work
      · 

Proof state:
case h.inr.h
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
μ : Measure Ω
τ σ : Ω → ι
E : Type u_4
p : ℝ≥0∞
u : ι → Ω → E
inst✝¹ : LinearOrder ι
inst✝ : AddCommMonoid E
s : Finset ι
n : ι
hbdd : ∀ (ω : Ω), τ ω < n → τ ω ∈ s
ω : Ω
h : τ ω < n
⊢ ω ∉ {a | n ≤ τ a}

Next tactic:
exact not_le.2 h
theorem stoppedProcess_eq_of_mem_finset [LinearOrder ι] [AddCommMonoid E] {s : Finset ι} (n : ι)
    (hbdd : ∀ ω, τ ω < n → τ ω ∈ s) : stoppedProcess u τ n = Set.indicator {a | n ≤ τ a} (u n) +
      ∑ i in s.filter (· < n), Set.indicator {ω | τ ω = i} (u i) := by
  ext ω
  rw [Pi.add_apply, Finset.sum_apply]
  rcases le_or_lt n (τ ω) with h | h
  · rw [stoppedProcess_eq_of_le h, Set.indicator_of_mem, Finset.sum_eq_zero, add_zero]
    · intro m hm
      refine' Set.indicator_of_not_mem _ _
      rw [Finset.mem_filter] at hm
      exact (hm.2.trans_le h).ne'
    · exact h
  · rw [stoppedProcess_eq_of_ge (le_of_lt h), Finset.sum_eq_single_of_mem (τ ω)]
    · rw [Set.indicator_of_not_mem, zero_add, Set.indicator_of_mem]
      · exact rfl
      -- refl does not work
      · exact not_le.2 h
    · 

Proof state:
case h.inr.h
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
μ : Measure Ω
τ σ : Ω → ι
E : Type u_4
p : ℝ≥0∞
u : ι → Ω → E
inst✝¹ : LinearOrder ι
inst✝ : AddCommMonoid E
s : Finset ι
n : ι
hbdd : ∀ (ω : Ω), τ ω < n → τ ω ∈ s
ω : Ω
h : τ ω < n
⊢ τ ω ∈ Finset.filter (fun x => x < n) s

Next tactic:
rw [Finset.mem_filter]
theorem stoppedProcess_eq_of_mem_finset [LinearOrder ι] [AddCommMonoid E] {s : Finset ι} (n : ι)
    (hbdd : ∀ ω, τ ω < n → τ ω ∈ s) : stoppedProcess u τ n = Set.indicator {a | n ≤ τ a} (u n) +
      ∑ i in s.filter (· < n), Set.indicator {ω | τ ω = i} (u i) := by
  ext ω
  rw [Pi.add_apply, Finset.sum_apply]
  rcases le_or_lt n (τ ω) with h | h
  · rw [stoppedProcess_eq_of_le h, Set.indicator_of_mem, Finset.sum_eq_zero, add_zero]
    · intro m hm
      refine' Set.indicator_of_not_mem _ _
      rw [Finset.mem_filter] at hm
      exact (hm.2.trans_le h).ne'
    · exact h
  · rw [stoppedProcess_eq_of_ge (le_of_lt h), Finset.sum_eq_single_of_mem (τ ω)]
    · rw [Set.indicator_of_not_mem, zero_add, Set.indicator_of_mem]
      · exact rfl
      -- refl does not work
      · exact not_le.2 h
    · rw [Finset.mem_filter]
      

Proof state:
case h.inr.h
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
μ : Measure Ω
τ σ : Ω → ι
E : Type u_4
p : ℝ≥0∞
u : ι → Ω → E
inst✝¹ : LinearOrder ι
inst✝ : AddCommMonoid E
s : Finset ι
n : ι
hbdd : ∀ (ω : Ω), τ ω < n → τ ω ∈ s
ω : Ω
h : τ ω < n
⊢ τ ω ∈ s ∧ τ ω < n

Next tactic:
exact ⟨hbdd ω h, h⟩
theorem stoppedProcess_eq_of_mem_finset [LinearOrder ι] [AddCommMonoid E] {s : Finset ι} (n : ι)
    (hbdd : ∀ ω, τ ω < n → τ ω ∈ s) : stoppedProcess u τ n = Set.indicator {a | n ≤ τ a} (u n) +
      ∑ i in s.filter (· < n), Set.indicator {ω | τ ω = i} (u i) := by
  ext ω
  rw [Pi.add_apply, Finset.sum_apply]
  rcases le_or_lt n (τ ω) with h | h
  · rw [stoppedProcess_eq_of_le h, Set.indicator_of_mem, Finset.sum_eq_zero, add_zero]
    · intro m hm
      refine' Set.indicator_of_not_mem _ _
      rw [Finset.mem_filter] at hm
      exact (hm.2.trans_le h).ne'
    · exact h
  · rw [stoppedProcess_eq_of_ge (le_of_lt h), Finset.sum_eq_single_of_mem (τ ω)]
    · rw [Set.indicator_of_not_mem, zero_add, Set.indicator_of_mem]
      · exact rfl
      -- refl does not work
      · exact not_le.2 h
    · rw [Finset.mem_filter]
      exact ⟨hbdd ω h, h⟩
    · 

Proof state:
case h.inr.h₀
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
μ : Measure Ω
τ σ : Ω → ι
E : Type u_4
p : ℝ≥0∞
u : ι → Ω → E
inst✝¹ : LinearOrder ι
inst✝ : AddCommMonoid E
s : Finset ι
n : ι
hbdd : ∀ (ω : Ω), τ ω < n → τ ω ∈ s
ω : Ω
h : τ ω < n
⊢ ∀ b ∈ Finset.filter (fun x => x < n) s, b ≠ τ ω → Set.indicator {ω | τ ω = b} (u b) ω = 0

Next tactic:
intro b _ hneq
theorem stoppedProcess_eq_of_mem_finset [LinearOrder ι] [AddCommMonoid E] {s : Finset ι} (n : ι)
    (hbdd : ∀ ω, τ ω < n → τ ω ∈ s) : stoppedProcess u τ n = Set.indicator {a | n ≤ τ a} (u n) +
      ∑ i in s.filter (· < n), Set.indicator {ω | τ ω = i} (u i) := by
  ext ω
  rw [Pi.add_apply, Finset.sum_apply]
  rcases le_or_lt n (τ ω) with h | h
  · rw [stoppedProcess_eq_of_le h, Set.indicator_of_mem, Finset.sum_eq_zero, add_zero]
    · intro m hm
      refine' Set.indicator_of_not_mem _ _
      rw [Finset.mem_filter] at hm
      exact (hm.2.trans_le h).ne'
    · exact h
  · rw [stoppedProcess_eq_of_ge (le_of_lt h), Finset.sum_eq_single_of_mem (τ ω)]
    · rw [Set.indicator_of_not_mem, zero_add, Set.indicator_of_mem]
      · exact rfl
      -- refl does not work
      · exact not_le.2 h
    · rw [Finset.mem_filter]
      exact ⟨hbdd ω h, h⟩
    · intro b _ hneq
      

Proof state:
case h.inr.h₀
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
μ : Measure Ω
τ σ : Ω → ι
E : Type u_4
p : ℝ≥0∞
u : ι → Ω → E
inst✝¹ : LinearOrder ι
inst✝ : AddCommMonoid E
s : Finset ι
n : ι
hbdd : ∀ (ω : Ω), τ ω < n → τ ω ∈ s
ω : Ω
h : τ ω < n
b : ι
a✝ : b ∈ Finset.filter (fun x => x < n) s
hneq : b ≠ τ ω
⊢ Set.indicator {ω | τ ω = b} (u b) ω = 0

Next tactic:
rw [Set.indicator_of_not_mem]
theorem stoppedProcess_eq_of_mem_finset [LinearOrder ι] [AddCommMonoid E] {s : Finset ι} (n : ι)
    (hbdd : ∀ ω, τ ω < n → τ ω ∈ s) : stoppedProcess u τ n = Set.indicator {a | n ≤ τ a} (u n) +
      ∑ i in s.filter (· < n), Set.indicator {ω | τ ω = i} (u i) := by
  ext ω
  rw [Pi.add_apply, Finset.sum_apply]
  rcases le_or_lt n (τ ω) with h | h
  · rw [stoppedProcess_eq_of_le h, Set.indicator_of_mem, Finset.sum_eq_zero, add_zero]
    · intro m hm
      refine' Set.indicator_of_not_mem _ _
      rw [Finset.mem_filter] at hm
      exact (hm.2.trans_le h).ne'
    · exact h
  · rw [stoppedProcess_eq_of_ge (le_of_lt h), Finset.sum_eq_single_of_mem (τ ω)]
    · rw [Set.indicator_of_not_mem, zero_add, Set.indicator_of_mem]
      · exact rfl
      -- refl does not work
      · exact not_le.2 h
    · rw [Finset.mem_filter]
      exact ⟨hbdd ω h, h⟩
    · intro b _ hneq
      rw [Set.indicator_of_not_mem]
      

Proof state:
case h.inr.h₀.h
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
μ : Measure Ω
τ σ : Ω → ι
E : Type u_4
p : ℝ≥0∞
u : ι → Ω → E
inst✝¹ : LinearOrder ι
inst✝ : AddCommMonoid E
s : Finset ι
n : ι
hbdd : ∀ (ω : Ω), τ ω < n → τ ω ∈ s
ω : Ω
h : τ ω < n
b : ι
a✝ : b ∈ Finset.filter (fun x => x < n) s
hneq : b ≠ τ ω
⊢ ω ∉ {ω | τ ω = b}

Next tactic:
exact hneq.symm
theorem stoppedProcess_eq'' [LinearOrder ι] [LocallyFiniteOrderBot ι] [AddCommMonoid E] (n : ι) :
    stoppedProcess u τ n = Set.indicator {a | n ≤ τ a} (u n) +
      ∑ i in Finset.Iio n, Set.indicator {ω | τ ω = i} (u i) := by
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
μ : Measure Ω
τ σ : Ω → ι
E : Type u_4
p : ℝ≥0∞
u : ι → Ω → E
inst✝² : LinearOrder ι
inst✝¹ : LocallyFiniteOrderBot ι
inst✝ : AddCommMonoid E
n : ι
⊢ stoppedProcess u τ n = Set.indicator {a | n ≤ τ a} (u n) + ∑ i in Finset.Iio n, Set.indicator {ω | τ ω = i} (u i)

Next tactic:
have h_mem : ∀ ω, τ ω < n → τ ω ∈ Finset.Iio n := fun ω h => Finset.mem_Iio.mpr h
theorem stoppedProcess_eq'' [LinearOrder ι] [LocallyFiniteOrderBot ι] [AddCommMonoid E] (n : ι) :
    stoppedProcess u τ n = Set.indicator {a | n ≤ τ a} (u n) +
      ∑ i in Finset.Iio n, Set.indicator {ω | τ ω = i} (u i) := by
  have h_mem : ∀ ω, τ ω < n → τ ω ∈ Finset.Iio n := fun ω h => Finset.mem_Iio.mpr h
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
μ : Measure Ω
τ σ : Ω → ι
E : Type u_4
p : ℝ≥0∞
u : ι → Ω → E
inst✝² : LinearOrder ι
inst✝¹ : LocallyFiniteOrderBot ι
inst✝ : AddCommMonoid E
n : ι
h_mem : ∀ (ω : Ω), τ ω < n → τ ω ∈ Finset.Iio n
⊢ stoppedProcess u τ n = Set.indicator {a | n ≤ τ a} (u n) + ∑ i in Finset.Iio n, Set.indicator {ω | τ ω = i} (u i)

Next tactic:
rw [stoppedProcess_eq_of_mem_finset n h_mem]
theorem stoppedProcess_eq'' [LinearOrder ι] [LocallyFiniteOrderBot ι] [AddCommMonoid E] (n : ι) :
    stoppedProcess u τ n = Set.indicator {a | n ≤ τ a} (u n) +
      ∑ i in Finset.Iio n, Set.indicator {ω | τ ω = i} (u i) := by
  have h_mem : ∀ ω, τ ω < n → τ ω ∈ Finset.Iio n := fun ω h => Finset.mem_Iio.mpr h
  rw [stoppedProcess_eq_of_mem_finset n h_mem]
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
μ : Measure Ω
τ σ : Ω → ι
E : Type u_4
p : ℝ≥0∞
u : ι → Ω → E
inst✝² : LinearOrder ι
inst✝¹ : LocallyFiniteOrderBot ι
inst✝ : AddCommMonoid E
n : ι
h_mem : ∀ (ω : Ω), τ ω < n → τ ω ∈ Finset.Iio n
⊢ Set.indicator {a | n ≤ τ a} (u n) +
      ∑ i in Finset.filter (fun x => x < n) (Finset.Iio n), Set.indicator {ω | τ ω = i} (u i) =
    Set.indicator {a | n ≤ τ a} (u n) + ∑ i in Finset.Iio n, Set.indicator {ω | τ ω = i} (u i)

Next tactic:
congr with i
theorem stoppedProcess_eq'' [LinearOrder ι] [LocallyFiniteOrderBot ι] [AddCommMonoid E] (n : ι) :
    stoppedProcess u τ n = Set.indicator {a | n ≤ τ a} (u n) +
      ∑ i in Finset.Iio n, Set.indicator {ω | τ ω = i} (u i) := by
  have h_mem : ∀ ω, τ ω < n → τ ω ∈ Finset.Iio n := fun ω h => Finset.mem_Iio.mpr h
  rw [stoppedProcess_eq_of_mem_finset n h_mem]
  congr with i
  

Proof state:
case e_a.e_s.a
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
μ : Measure Ω
τ σ : Ω → ι
E : Type u_4
p : ℝ≥0∞
u : ι → Ω → E
inst✝² : LinearOrder ι
inst✝¹ : LocallyFiniteOrderBot ι
inst✝ : AddCommMonoid E
n : ι
h_mem : ∀ (ω : Ω), τ ω < n → τ ω ∈ Finset.Iio n
i : ι
⊢ i ∈ Finset.filter (fun x => x < n) (Finset.Iio n) ↔ i ∈ Finset.Iio n

Next tactic:
simp
theorem memℒp_stoppedValue_of_mem_finset (hτ : IsStoppingTime ℱ τ) (hu : ∀ n, Memℒp (u n) p μ)
    {s : Finset ι} (hbdd : ∀ ω, τ ω ∈ s) : Memℒp (stoppedValue u τ) p μ := by
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
μ : Measure Ω
τ σ : Ω → ι
E : Type u_4
p : ℝ≥0∞
u : ι → Ω → E
inst✝¹ : PartialOrder ι
ℱ : Filtration ι m
inst✝ : NormedAddCommGroup E
hτ : IsStoppingTime ℱ τ
hu : ∀ (n : ι), Memℒp (u n) p
s : Finset ι
hbdd : ∀ (ω : Ω), τ ω ∈ s
⊢ Memℒp (stoppedValue u τ) p

Next tactic:
rw [stoppedValue_eq_of_mem_finset hbdd]
theorem memℒp_stoppedValue_of_mem_finset (hτ : IsStoppingTime ℱ τ) (hu : ∀ n, Memℒp (u n) p μ)
    {s : Finset ι} (hbdd : ∀ ω, τ ω ∈ s) : Memℒp (stoppedValue u τ) p μ := by
  rw [stoppedValue_eq_of_mem_finset hbdd]
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
μ : Measure Ω
τ σ : Ω → ι
E : Type u_4
p : ℝ≥0∞
u : ι → Ω → E
inst✝¹ : PartialOrder ι
ℱ : Filtration ι m
inst✝ : NormedAddCommGroup E
hτ : IsStoppingTime ℱ τ
hu : ∀ (n : ι), Memℒp (u n) p
s : Finset ι
hbdd : ∀ (ω : Ω), τ ω ∈ s
⊢ Memℒp (∑ i in s, Set.indicator {ω | τ ω = i} (u i)) p

Next tactic:
refine' memℒp_finset_sum' _ fun i _ => Memℒp.indicator _ (hu i)
theorem memℒp_stoppedValue_of_mem_finset (hτ : IsStoppingTime ℱ τ) (hu : ∀ n, Memℒp (u n) p μ)
    {s : Finset ι} (hbdd : ∀ ω, τ ω ∈ s) : Memℒp (stoppedValue u τ) p μ := by
  rw [stoppedValue_eq_of_mem_finset hbdd]
  refine' memℒp_finset_sum' _ fun i _ => Memℒp.indicator _ (hu i)
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
μ : Measure Ω
τ σ : Ω → ι
E : Type u_4
p : ℝ≥0∞
u : ι → Ω → E
inst✝¹ : PartialOrder ι
ℱ : Filtration ι m
inst✝ : NormedAddCommGroup E
hτ : IsStoppingTime ℱ τ
hu : ∀ (n : ι), Memℒp (u n) p
s : Finset ι
hbdd : ∀ (ω : Ω), τ ω ∈ s
i : ι
x✝ : i ∈ s
⊢ MeasurableSet {ω | τ ω = i}

Next tactic:
refine' ℱ.le i {a : Ω | τ a = i} (hτ.measurableSet_eq_of_countable_range _ i)
theorem memℒp_stoppedValue_of_mem_finset (hτ : IsStoppingTime ℱ τ) (hu : ∀ n, Memℒp (u n) p μ)
    {s : Finset ι} (hbdd : ∀ ω, τ ω ∈ s) : Memℒp (stoppedValue u τ) p μ := by
  rw [stoppedValue_eq_of_mem_finset hbdd]
  refine' memℒp_finset_sum' _ fun i _ => Memℒp.indicator _ (hu i)
  refine' ℱ.le i {a : Ω | τ a = i} (hτ.measurableSet_eq_of_countable_range _ i)
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
μ : Measure Ω
τ σ : Ω → ι
E : Type u_4
p : ℝ≥0∞
u : ι → Ω → E
inst✝¹ : PartialOrder ι
ℱ : Filtration ι m
inst✝ : NormedAddCommGroup E
hτ : IsStoppingTime ℱ τ
hu : ∀ (n : ι), Memℒp (u n) p
s : Finset ι
hbdd : ∀ (ω : Ω), τ ω ∈ s
i : ι
x✝ : i ∈ s
⊢ Set.Countable (Set.range τ)

Next tactic:
refine' ((Finset.finite_toSet s).subset fun ω hω => _).countable
theorem memℒp_stoppedValue_of_mem_finset (hτ : IsStoppingTime ℱ τ) (hu : ∀ n, Memℒp (u n) p μ)
    {s : Finset ι} (hbdd : ∀ ω, τ ω ∈ s) : Memℒp (stoppedValue u τ) p μ := by
  rw [stoppedValue_eq_of_mem_finset hbdd]
  refine' memℒp_finset_sum' _ fun i _ => Memℒp.indicator _ (hu i)
  refine' ℱ.le i {a : Ω | τ a = i} (hτ.measurableSet_eq_of_countable_range _ i)
  refine' ((Finset.finite_toSet s).subset fun ω hω => _).countable
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
μ : Measure Ω
τ σ : Ω → ι
E : Type u_4
p : ℝ≥0∞
u : ι → Ω → E
inst✝¹ : PartialOrder ι
ℱ : Filtration ι m
inst✝ : NormedAddCommGroup E
hτ : IsStoppingTime ℱ τ
hu : ∀ (n : ι), Memℒp (u n) p
s : Finset ι
hbdd : ∀ (ω : Ω), τ ω ∈ s
i : ι
x✝ : i ∈ s
ω : ι
hω : ω ∈ Set.range τ
⊢ ω ∈ ↑s

Next tactic:
obtain ⟨y, rfl⟩ := hω
theorem memℒp_stoppedValue_of_mem_finset (hτ : IsStoppingTime ℱ τ) (hu : ∀ n, Memℒp (u n) p μ)
    {s : Finset ι} (hbdd : ∀ ω, τ ω ∈ s) : Memℒp (stoppedValue u τ) p μ := by
  rw [stoppedValue_eq_of_mem_finset hbdd]
  refine' memℒp_finset_sum' _ fun i _ => Memℒp.indicator _ (hu i)
  refine' ℱ.le i {a : Ω | τ a = i} (hτ.measurableSet_eq_of_countable_range _ i)
  refine' ((Finset.finite_toSet s).subset fun ω hω => _).countable
  obtain ⟨y, rfl⟩ := hω
  

Proof state:
case intro
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
μ : Measure Ω
τ σ : Ω → ι
E : Type u_4
p : ℝ≥0∞
u : ι → Ω → E
inst✝¹ : PartialOrder ι
ℱ : Filtration ι m
inst✝ : NormedAddCommGroup E
hτ : IsStoppingTime ℱ τ
hu : ∀ (n : ι), Memℒp (u n) p
s : Finset ι
hbdd : ∀ (ω : Ω), τ ω ∈ s
i : ι
x✝ : i ∈ s
y : Ω
⊢ τ y ∈ ↑s

Next tactic:
exact hbdd y
theorem integrable_stoppedValue_of_mem_finset (hτ : IsStoppingTime ℱ τ)
    (hu : ∀ n, Integrable (u n) μ) {s : Finset ι} (hbdd : ∀ ω, τ ω ∈ s) :
    Integrable (stoppedValue u τ) μ := by
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
μ : Measure Ω
τ σ : Ω → ι
E : Type u_4
p : ℝ≥0∞
u : ι → Ω → E
inst✝¹ : PartialOrder ι
ℱ : Filtration ι m
inst✝ : NormedAddCommGroup E
hτ : IsStoppingTime ℱ τ
hu : ∀ (n : ι), Integrable (u n)
s : Finset ι
hbdd : ∀ (ω : Ω), τ ω ∈ s
⊢ Integrable (stoppedValue u τ)

Next tactic:
simp_rw [← memℒp_one_iff_integrable] at hu ⊢
theorem integrable_stoppedValue_of_mem_finset (hτ : IsStoppingTime ℱ τ)
    (hu : ∀ n, Integrable (u n) μ) {s : Finset ι} (hbdd : ∀ ω, τ ω ∈ s) :
    Integrable (stoppedValue u τ) μ := by
  simp_rw [← memℒp_one_iff_integrable] at hu ⊢
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
μ : Measure Ω
τ σ : Ω → ι
E : Type u_4
p : ℝ≥0∞
u : ι → Ω → E
inst✝¹ : PartialOrder ι
ℱ : Filtration ι m
inst✝ : NormedAddCommGroup E
hτ : IsStoppingTime ℱ τ
s : Finset ι
hbdd : ∀ (ω : Ω), τ ω ∈ s
hu : ∀ (n : ι), Memℒp (u n) 1
⊢ Memℒp (stoppedValue u τ) 1

Next tactic:
exact memℒp_stoppedValue_of_mem_finset hτ hu hbdd
theorem memℒp_stoppedProcess_of_mem_finset (hτ : IsStoppingTime ℱ τ) (hu : ∀ n, Memℒp (u n) p μ)
    (n : ι) {s : Finset ι} (hbdd : ∀ ω, τ ω < n → τ ω ∈ s) : Memℒp (stoppedProcess u τ n) p μ := by
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
μ : Measure Ω
τ σ : Ω → ι
E : Type u_4
p : ℝ≥0∞
u : ι → Ω → E
inst✝⁴ : LinearOrder ι
inst✝³ : TopologicalSpace ι
inst✝² : OrderTopology ι
inst✝¹ : FirstCountableTopology ι
ℱ : Filtration ι m
inst✝ : NormedAddCommGroup E
hτ : IsStoppingTime ℱ τ
hu : ∀ (n : ι), Memℒp (u n) p
n : ι
s : Finset ι
hbdd : ∀ (ω : Ω), τ ω < n → τ ω ∈ s
⊢ Memℒp (stoppedProcess u τ n) p

Next tactic:
rw [stoppedProcess_eq_of_mem_finset n hbdd]
theorem memℒp_stoppedProcess_of_mem_finset (hτ : IsStoppingTime ℱ τ) (hu : ∀ n, Memℒp (u n) p μ)
    (n : ι) {s : Finset ι} (hbdd : ∀ ω, τ ω < n → τ ω ∈ s) : Memℒp (stoppedProcess u τ n) p μ := by
  rw [stoppedProcess_eq_of_mem_finset n hbdd]
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
μ : Measure Ω
τ σ : Ω → ι
E : Type u_4
p : ℝ≥0∞
u : ι → Ω → E
inst✝⁴ : LinearOrder ι
inst✝³ : TopologicalSpace ι
inst✝² : OrderTopology ι
inst✝¹ : FirstCountableTopology ι
ℱ : Filtration ι m
inst✝ : NormedAddCommGroup E
hτ : IsStoppingTime ℱ τ
hu : ∀ (n : ι), Memℒp (u n) p
n : ι
s : Finset ι
hbdd : ∀ (ω : Ω), τ ω < n → τ ω ∈ s
⊢ Memℒp (Set.indicator {a | n ≤ τ a} (u n) + ∑ i in Finset.filter (fun x => x < n) s, Set.indicator {ω | τ ω = i} (u i))
    p

Next tactic:
refine' Memℒp.add _ _
theorem memℒp_stoppedProcess_of_mem_finset (hτ : IsStoppingTime ℱ τ) (hu : ∀ n, Memℒp (u n) p μ)
    (n : ι) {s : Finset ι} (hbdd : ∀ ω, τ ω < n → τ ω ∈ s) : Memℒp (stoppedProcess u τ n) p μ := by
  rw [stoppedProcess_eq_of_mem_finset n hbdd]
  refine' Memℒp.add _ _
  · 

Proof state:
case refine'_1
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
μ : Measure Ω
τ σ : Ω → ι
E : Type u_4
p : ℝ≥0∞
u : ι → Ω → E
inst✝⁴ : LinearOrder ι
inst✝³ : TopologicalSpace ι
inst✝² : OrderTopology ι
inst✝¹ : FirstCountableTopology ι
ℱ : Filtration ι m
inst✝ : NormedAddCommGroup E
hτ : IsStoppingTime ℱ τ
hu : ∀ (n : ι), Memℒp (u n) p
n : ι
s : Finset ι
hbdd : ∀ (ω : Ω), τ ω < n → τ ω ∈ s
⊢ Memℒp (Set.indicator {a | n ≤ τ a} (u n)) p

Next tactic:
exact Memℒp.indicator (ℱ.le n {a : Ω | n ≤ τ a} (hτ.measurableSet_ge n)) (hu n)
theorem memℒp_stoppedProcess_of_mem_finset (hτ : IsStoppingTime ℱ τ) (hu : ∀ n, Memℒp (u n) p μ)
    (n : ι) {s : Finset ι} (hbdd : ∀ ω, τ ω < n → τ ω ∈ s) : Memℒp (stoppedProcess u τ n) p μ := by
  rw [stoppedProcess_eq_of_mem_finset n hbdd]
  refine' Memℒp.add _ _
  · exact Memℒp.indicator (ℱ.le n {a : Ω | n ≤ τ a} (hτ.measurableSet_ge n)) (hu n)
  · 

Proof state:
case refine'_2
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
μ : Measure Ω
τ σ : Ω → ι
E : Type u_4
p : ℝ≥0∞
u : ι → Ω → E
inst✝⁴ : LinearOrder ι
inst✝³ : TopologicalSpace ι
inst✝² : OrderTopology ι
inst✝¹ : FirstCountableTopology ι
ℱ : Filtration ι m
inst✝ : NormedAddCommGroup E
hτ : IsStoppingTime ℱ τ
hu : ∀ (n : ι), Memℒp (u n) p
n : ι
s : Finset ι
hbdd : ∀ (ω : Ω), τ ω < n → τ ω ∈ s
⊢ Memℒp (∑ i in Finset.filter (fun x => x < n) s, Set.indicator {ω | τ ω = i} (u i)) p

Next tactic:
suffices Memℒp (fun ω => ∑ i in s.filter (· < n), {a : Ω | τ a = i}.indicator (u i) ω) p μ by
      convert this using 1; ext1 ω; simp only [Finset.sum_apply]