Theorem: MeasureTheory.IsStoppingTime.piecewise_of_le
File: Mathlib/Probability/Process/Stopping.lean

Proof steps:
state_before: Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝¹ : Preorder ι
𝒢 : Filtration ι m
τ η : Ω → ι
i j : ι
s : Set Ω
inst✝ : DecidablePred fun x => x ∈ s
hτ_st : IsStoppingTime 𝒢 τ
hη_st : IsStoppingTime 𝒢 η
hτ : ∀ (ω : Ω), i ≤ τ ω
hη : ∀ (ω : Ω), i ≤ η ω
hs : MeasurableSet s
⊢ IsStoppingTime 𝒢 (s.piecewise τ η)
state_after: Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝¹ : Preorder ι
𝒢 : Filtration ι m
τ η : Ω → ι
i j : ι
s : Set Ω
inst✝ : DecidablePred fun x => x ∈ s
hτ_st : IsStoppingTime 𝒢 τ
hη_st : IsStoppingTime 𝒢 η
hτ : ∀ (ω : Ω), i ≤ τ ω
hη : ∀ (ω : Ω), i ≤ η ω
hs : MeasurableSet s
n : ι
⊢ MeasurableSet {ω | s.piecewise τ η ω ≤ n}
tactic: intro n
state_before: Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝¹ : Preorder ι
𝒢 : Filtration ι m
τ η : Ω → ι
i j : ι
s : Set Ω
inst✝ : DecidablePred fun x => x ∈ s
hτ_st : IsStoppingTime 𝒢 τ
hη_st : IsStoppingTime 𝒢 η
hτ : ∀ (ω : Ω), i ≤ τ ω
hη : ∀ (ω : Ω), i ≤ η ω
hs : MeasurableSet s
n : ι
⊢ MeasurableSet {ω | s.piecewise τ η ω ≤ n}
state_after: Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝¹ : Preorder ι
𝒢 : Filtration ι m
τ η : Ω → ι
i j : ι
s : Set Ω
inst✝ : DecidablePred fun x => x ∈ s
hτ_st : IsStoppingTime 𝒢 τ
hη_st : IsStoppingTime 𝒢 η
hτ : ∀ (ω : Ω), i ≤ τ ω
hη : ∀ (ω : Ω), i ≤ η ω
hs : MeasurableSet s
n : ι
this : {ω | s.piecewise τ η ω ≤ n} = s ∩ {ω | τ ω ≤ n} ∪ sᶜ ∩ {ω | η ω ≤ n}
⊢ MeasurableSet {ω | s.piecewise τ η ω ≤ n}
tactic: have : {ω | s.piecewise τ η ω ≤ n} = s ∩ {ω | τ ω ≤ n} ∪ sᶜ ∩ {ω | η ω ≤ n} := by
    ext1 ω
    simp only [Set.piecewise, Set.mem_inter_iff, Set.mem_setOf_eq, and_congr_right_iff]
    by_cases hx : ω ∈ s <;> simp [hx]
state_before: Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝¹ : Preorder ι
𝒢 : Filtration ι m
τ η : Ω → ι
i j : ι
s : Set Ω
inst✝ : DecidablePred fun x => x ∈ s
hτ_st : IsStoppingTime 𝒢 τ
hη_st : IsStoppingTime 𝒢 η
hτ : ∀ (ω : Ω), i ≤ τ ω
hη : ∀ (ω : Ω), i ≤ η ω
hs : MeasurableSet s
n : ι
this : {ω | s.piecewise τ η ω ≤ n} = s ∩ {ω | τ ω ≤ n} ∪ sᶜ ∩ {ω | η ω ≤ n}
⊢ MeasurableSet {ω | s.piecewise τ η ω ≤ n}
state_after: Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝¹ : Preorder ι
𝒢 : Filtration ι m
τ η : Ω → ι
i j : ι
s : Set Ω
inst✝ : DecidablePred fun x => x ∈ s
hτ_st : IsStoppingTime 𝒢 τ
hη_st : IsStoppingTime 𝒢 η
hτ : ∀ (ω : Ω), i ≤ τ ω
hη : ∀ (ω : Ω), i ≤ η ω
hs : MeasurableSet s
n : ι
this : {ω | s.piecewise τ η ω ≤ n} = s ∩ {ω | τ ω ≤ n} ∪ sᶜ ∩ {ω | η ω ≤ n}
⊢ MeasurableSet (s ∩ {ω | τ ω ≤ n} ∪ sᶜ ∩ {ω | η ω ≤ n})
tactic: rw [this]
state_before: Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝¹ : Preorder ι
𝒢 : Filtration ι m
τ η : Ω → ι
i j : ι
s : Set Ω
inst✝ : DecidablePred fun x => x ∈ s
hτ_st : IsStoppingTime 𝒢 τ
hη_st : IsStoppingTime 𝒢 η
hτ : ∀ (ω : Ω), i ≤ τ ω
hη : ∀ (ω : Ω), i ≤ η ω
hs : MeasurableSet s
n : ι
this : {ω | s.piecewise τ η ω ≤ n} = s ∩ {ω | τ ω ≤ n} ∪ sᶜ ∩ {ω | η ω ≤ n}
⊢ MeasurableSet (s ∩ {ω | τ ω ≤ n} ∪ sᶜ ∩ {ω | η ω ≤ n})
state_after: case pos
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝¹ : Preorder ι
𝒢 : Filtration ι m
τ η : Ω → ι
i j : ι
s : Set Ω
inst✝ : DecidablePred fun x => x ∈ s
hτ_st : IsStoppingTime 𝒢 τ
hη_st : IsStoppingTime 𝒢 η
hτ : ∀ (ω : Ω), i ≤ τ ω
hη : ∀ (ω : Ω), i ≤ η ω
hs : MeasurableSet s
n : ι
this : {ω | s.piecewise τ η ω ≤ n} = s ∩ {ω | τ ω ≤ n} ∪ sᶜ ∩ {ω | η ω ≤ n}
hin : i ≤ n
⊢ MeasurableSet (s ∩ {ω | τ ω ≤ n} ∪ sᶜ ∩ {ω | η ω ≤ n})

case neg
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝¹ : Preorder ι
𝒢 : Filtration ι m
τ η : Ω → ι
i j : ι
s : Set Ω
inst✝ : DecidablePred fun x => x ∈ s
hτ_st : IsStoppingTime 𝒢 τ
hη_st : IsStoppingTime 𝒢 η
hτ : ∀ (ω : Ω), i ≤ τ ω
hη : ∀ (ω : Ω), i ≤ η ω
hs : MeasurableSet s
n : ι
this : {ω | s.piecewise τ η ω ≤ n} = s ∩ {ω | τ ω ≤ n} ∪ sᶜ ∩ {ω | η ω ≤ n}
hin : ¬i ≤ n
⊢ MeasurableSet (s ∩ {ω | τ ω ≤ n} ∪ sᶜ ∩ {ω | η ω ≤ n})
tactic: by_cases hin : i ≤ n