Theorem: MeasureTheory.stoppedValue_sub_eq_sum'
File: Mathlib/Probability/Process/Stopping.lean

tactic: rw [stoppedValue_sub_eq_sum hle]
state_before: Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
f : Filtration ℕ m
u : ℕ → Ω → β
τ π : Ω → ℕ
inst✝ : AddCommGroup β
hle : τ ≤ π
N : ℕ
hbdd : ∀ (ω : Ω), π ω ≤ N
⊢ stoppedValue u π - stoppedValue u τ = fun ω =>
    (∑ i ∈ Finset.range (N + 1), {ω | τ ω ≤ i ∧ i < π ω}.indicator (u (i + 1) - u i)) ω
state_after: Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
f : Filtration ℕ m
u : ℕ → Ω → β
τ π : Ω → ℕ
inst✝ : AddCommGroup β
hle : τ ≤ π
N : ℕ
hbdd : ∀ (ω : Ω), π ω ≤ N
⊢ (fun ω => (∑ i ∈ Finset.Ico (τ ω) (π ω), (u (i + 1) - u i)) ω) = fun ω =>
    (∑ i ∈ Finset.range (N + 1), {ω | τ ω ≤ i ∧ i < π ω}.indicator (u (i + 1) - u i)) ω

tactic: ext ω
state_before: Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
f : Filtration ℕ m
u : ℕ → Ω → β
τ π : Ω → ℕ
inst✝ : AddCommGroup β
hle : τ ≤ π
N : ℕ
hbdd : ∀ (ω : Ω), π ω ≤ N
⊢ (fun ω => (∑ i ∈ Finset.Ico (τ ω) (π ω), (u (i + 1) - u i)) ω) = fun ω =>
    (∑ i ∈ Finset.range (N + 1), {ω | τ ω ≤ i ∧ i < π ω}.indicator (u (i + 1) - u i)) ω
state_after: case h
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
f : Filtration ℕ m
u : ℕ → Ω → β
τ π : Ω → ℕ
inst✝ : AddCommGroup β
hle : τ ≤ π
N : ℕ
hbdd : ∀ (ω : Ω), π ω ≤ N
ω : Ω
⊢ (∑ i ∈ Finset.Ico (τ ω) (π ω), (u (i + 1) - u i)) ω =
    (∑ i ∈ Finset.range (N + 1), {ω | τ ω ≤ i ∧ i < π ω}.indicator (u (i + 1) - u i)) ω

tactic: simp only [Finset.sum_apply, Finset.sum_indicator_eq_sum_filter]
state_before: case h
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
f : Filtration ℕ m
u : ℕ → Ω → β
τ π : Ω → ℕ
inst✝ : AddCommGroup β
hle : τ ≤ π
N : ℕ
hbdd : ∀ (ω : Ω), π ω ≤ N
ω : Ω
⊢ (∑ i ∈ Finset.Ico (τ ω) (π ω), (u (i + 1) - u i)) ω =
    (∑ i ∈ Finset.range (N + 1), {ω | τ ω ≤ i ∧ i < π ω}.indicator (u (i + 1) - u i)) ω
state_after: case h
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
f : Filtration ℕ m
u : ℕ → Ω → β
τ π : Ω → ℕ
inst✝ : AddCommGroup β
hle : τ ≤ π
N : ℕ
hbdd : ∀ (ω : Ω), π ω ≤ N
ω : Ω
⊢ ∑ c ∈ Finset.Ico (τ ω) (π ω), (u (c + 1) - u c) ω =
    ∑ c ∈ Finset.filter (fun i => ω ∈ {ω | τ ω ≤ i ∧ i < π ω}) (Finset.range (N + 1)), (u (c + 1) - u c) ω

tactic: refine Finset.sum_congr ?_ fun _ _ => rfl
state_before: case h
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
f : Filtration ℕ m
u : ℕ → Ω → β
τ π : Ω → ℕ
inst✝ : AddCommGroup β
hle : τ ≤ π
N : ℕ
hbdd : ∀ (ω : Ω), π ω ≤ N
ω : Ω
⊢ ∑ c ∈ Finset.Ico (τ ω) (π ω), (u (c + 1) - u c) ω =
    ∑ c ∈ Finset.filter (fun i => ω ∈ {ω | τ ω ≤ i ∧ i < π ω}) (Finset.range (N + 1)), (u (c + 1) - u c) ω
state_after: case h
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
f : Filtration ℕ m
u : ℕ → Ω → β
τ π : Ω → ℕ
inst✝ : AddCommGroup β
hle : τ ≤ π
N : ℕ
hbdd : ∀ (ω : Ω), π ω ≤ N
ω : Ω
⊢ Finset.Ico (τ ω) (π ω) = Finset.filter (fun i => ω ∈ {ω | τ ω ≤ i ∧ i < π ω}) (Finset.range (N + 1))

tactic: ext i
state_before: case h
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
f : Filtration ℕ m
u : ℕ → Ω → β
τ π : Ω → ℕ
inst✝ : AddCommGroup β
hle : τ ≤ π
N : ℕ
hbdd : ∀ (ω : Ω), π ω ≤ N
ω : Ω
⊢ Finset.Ico (τ ω) (π ω) = Finset.filter (fun i => ω ∈ {ω | τ ω ≤ i ∧ i < π ω}) (Finset.range (N + 1))
state_after: case h.a
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
f : Filtration ℕ m
u : ℕ → Ω → β
τ π : Ω → ℕ
inst✝ : AddCommGroup β
hle : τ ≤ π
N : ℕ
hbdd : ∀ (ω : Ω), π ω ≤ N
ω : Ω
i : ℕ
⊢ i ∈ Finset.Ico (τ ω) (π ω) ↔ i ∈ Finset.filter (fun i => ω ∈ {ω | τ ω ≤ i ∧ i < π ω}) (Finset.range (N + 1))

tactic: simp only [Finset.mem_filter, Set.mem_setOf_eq, Finset.mem_range, Finset.mem_Ico]
state_before: case h.a
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
f : Filtration ℕ m
u : ℕ → Ω → β
τ π : Ω → ℕ
inst✝ : AddCommGroup β
hle : τ ≤ π
N : ℕ
hbdd : ∀ (ω : Ω), π ω ≤ N
ω : Ω
i : ℕ
⊢ i ∈ Finset.Ico (τ ω) (π ω) ↔ i ∈ Finset.filter (fun i => ω ∈ {ω | τ ω ≤ i ∧ i < π ω}) (Finset.range (N + 1))
state_after: case h.a
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
f : Filtration ℕ m
u : ℕ → Ω → β
τ π : Ω → ℕ
inst✝ : AddCommGroup β
hle : τ ≤ π
N : ℕ
hbdd : ∀ (ω : Ω), π ω ≤ N
ω : Ω
i : ℕ
⊢ τ ω ≤ i ∧ i < π ω ↔ i < N + 1 ∧ τ ω ≤ i ∧ i < π ω

tactic: exact ⟨fun h => ⟨lt_trans h.2 (Nat.lt_succ_iff.2 <| hbdd _), h⟩, fun h => h.2⟩
state_before: case h.a
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
f : Filtration ℕ m
u : ℕ → Ω → β
τ π : Ω → ℕ
inst✝ : AddCommGroup β
hle : τ ≤ π
N : ℕ
hbdd : ∀ (ω : Ω), π ω ≤ N
ω : Ω
i : ℕ
⊢ τ ω ≤ i ∧ i < π ω ↔ i < N + 1 ∧ τ ω ≤ i ∧ i < π ω
state_after: no goals