l3lab/ntp-mathlib huggingface dataset:
theorem IsStoppingTime.measurableSet_ge (hτ : IsStoppingTime f τ) (i : ι) :
    MeasurableSet[f i] {ω | i ≤ τ ω} := by
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝³ : LinearOrder ι
f : Filtration ι m
τ : Ω → ι
inst✝² : TopologicalSpace ι
inst✝¹ : OrderTopology ι
inst✝ : FirstCountableTopology ι
hτ : IsStoppingTime f τ
i : ι
⊢ MeasurableSet {ω | i ≤ τ ω}

Next tactic:
have : {ω | i ≤ τ ω} = {ω | τ ω < i}ᶜ := by
    ext1 ω; simp only [Set.mem_setOf_eq, Set.mem_compl_iff, not_lt]
theorem IsStoppingTime.measurableSet_ge (hτ : IsStoppingTime f τ) (i : ι) :
    MeasurableSet[f i] {ω | i ≤ τ ω} := by
  have : {ω | i ≤ τ ω} = {ω | τ ω < i}ᶜ := by
    

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝³ : LinearOrder ι
f : Filtration ι m
τ : Ω → ι
inst✝² : TopologicalSpace ι
inst✝¹ : OrderTopology ι
inst✝ : FirstCountableTopology ι
hτ : IsStoppingTime f τ
i : ι
⊢ {ω | i ≤ τ ω} = {ω | τ ω < i}ᶜ

Next tactic:
ext1 ω
theorem IsStoppingTime.measurableSet_ge (hτ : IsStoppingTime f τ) (i : ι) :
    MeasurableSet[f i] {ω | i ≤ τ ω} := by
  have : {ω | i ≤ τ ω} = {ω | τ ω < i}ᶜ := by
    ext1 ω; 

Proof state:
case h
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝³ : LinearOrder ι
f : Filtration ι m
τ : Ω → ι
inst✝² : TopologicalSpace ι
inst✝¹ : OrderTopology ι
inst✝ : FirstCountableTopology ι
hτ : IsStoppingTime f τ
i : ι
ω : Ω
⊢ ω ∈ {ω | i ≤ τ ω} ↔ ω ∈ {ω | τ ω < i}ᶜ

Next tactic:
simp only [Set.mem_setOf_eq, Set.mem_compl_iff, not_lt]
theorem IsStoppingTime.measurableSet_ge (hτ : IsStoppingTime f τ) (i : ι) :
    MeasurableSet[f i] {ω | i ≤ τ ω} := by
  have : {ω | i ≤ τ ω} = {ω | τ ω < i}ᶜ := by
    ext1 ω; simp only [Set.mem_setOf_eq, Set.mem_compl_iff, not_lt]
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝³ : LinearOrder ι
f : Filtration ι m
τ : Ω → ι
inst✝² : TopologicalSpace ι
inst✝¹ : OrderTopology ι
inst✝ : FirstCountableTopology ι
hτ : IsStoppingTime f τ
i : ι
this : {ω | i ≤ τ ω} = {ω | τ ω < i}ᶜ
⊢ MeasurableSet {ω | i ≤ τ ω}

Next tactic:
rw [this]
theorem IsStoppingTime.measurableSet_ge (hτ : IsStoppingTime f τ) (i : ι) :
    MeasurableSet[f i] {ω | i ≤ τ ω} := by
  have : {ω | i ≤ τ ω} = {ω | τ ω < i}ᶜ := by
    ext1 ω; simp only [Set.mem_setOf_eq, Set.mem_compl_iff, not_lt]
  rw [this]
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝³ : LinearOrder ι
f : Filtration ι m
τ : Ω → ι
inst✝² : TopologicalSpace ι
inst✝¹ : OrderTopology ι
inst✝ : FirstCountableTopology ι
hτ : IsStoppingTime f τ
i : ι
this : {ω | i ≤ τ ω} = {ω | τ ω < i}ᶜ
⊢ MeasurableSet {ω | τ ω < i}ᶜ

Next tactic:
exact (hτ.measurableSet_lt i).compl
theorem IsStoppingTime.measurableSet_eq (hτ : IsStoppingTime f τ) (i : ι) :
    MeasurableSet[f i] {ω | τ ω = i} := by
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝³ : LinearOrder ι
f : Filtration ι m
τ : Ω → ι
inst✝² : TopologicalSpace ι
inst✝¹ : OrderTopology ι
inst✝ : FirstCountableTopology ι
hτ : IsStoppingTime f τ
i : ι
⊢ MeasurableSet {ω | τ ω = i}

Next tactic:
have : {ω | τ ω = i} = {ω | τ ω ≤ i} ∩ {ω | τ ω ≥ i} := by
    ext1 ω; simp only [Set.mem_setOf_eq, ge_iff_le, Set.mem_inter_iff, le_antisymm_iff]
theorem IsStoppingTime.measurableSet_eq (hτ : IsStoppingTime f τ) (i : ι) :
    MeasurableSet[f i] {ω | τ ω = i} := by
  have : {ω | τ ω = i} = {ω | τ ω ≤ i} ∩ {ω | τ ω ≥ i} := by
    

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝³ : LinearOrder ι
f : Filtration ι m
τ : Ω → ι
inst✝² : TopologicalSpace ι
inst✝¹ : OrderTopology ι
inst✝ : FirstCountableTopology ι
hτ : IsStoppingTime f τ
i : ι
⊢ {ω | τ ω = i} = {ω | τ ω ≤ i} ∩ {ω | τ ω ≥ i}

Next tactic:
ext1 ω
theorem IsStoppingTime.measurableSet_eq (hτ : IsStoppingTime f τ) (i : ι) :
    MeasurableSet[f i] {ω | τ ω = i} := by
  have : {ω | τ ω = i} = {ω | τ ω ≤ i} ∩ {ω | τ ω ≥ i} := by
    ext1 ω; 

Proof state:
case h
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝³ : LinearOrder ι
f : Filtration ι m
τ : Ω → ι
inst✝² : TopologicalSpace ι
inst✝¹ : OrderTopology ι
inst✝ : FirstCountableTopology ι
hτ : IsStoppingTime f τ
i : ι
ω : Ω
⊢ ω ∈ {ω | τ ω = i} ↔ ω ∈ {ω | τ ω ≤ i} ∩ {ω | τ ω ≥ i}

Next tactic:
simp only [Set.mem_setOf_eq, ge_iff_le, Set.mem_inter_iff, le_antisymm_iff]
theorem IsStoppingTime.measurableSet_eq (hτ : IsStoppingTime f τ) (i : ι) :
    MeasurableSet[f i] {ω | τ ω = i} := by
  have : {ω | τ ω = i} = {ω | τ ω ≤ i} ∩ {ω | τ ω ≥ i} := by
    ext1 ω; simp only [Set.mem_setOf_eq, ge_iff_le, Set.mem_inter_iff, le_antisymm_iff]
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝³ : LinearOrder ι
f : Filtration ι m
τ : Ω → ι
inst✝² : TopologicalSpace ι
inst✝¹ : OrderTopology ι
inst✝ : FirstCountableTopology ι
hτ : IsStoppingTime f τ
i : ι
this : {ω | τ ω = i} = {ω | τ ω ≤ i} ∩ {ω | τ ω ≥ i}
⊢ MeasurableSet {ω | τ ω = i}

Next tactic:
rw [this]
theorem IsStoppingTime.measurableSet_eq (hτ : IsStoppingTime f τ) (i : ι) :
    MeasurableSet[f i] {ω | τ ω = i} := by
  have : {ω | τ ω = i} = {ω | τ ω ≤ i} ∩ {ω | τ ω ≥ i} := by
    ext1 ω; simp only [Set.mem_setOf_eq, ge_iff_le, Set.mem_inter_iff, le_antisymm_iff]
  rw [this]
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝³ : LinearOrder ι
f : Filtration ι m
τ : Ω → ι
inst✝² : TopologicalSpace ι
inst✝¹ : OrderTopology ι
inst✝ : FirstCountableTopology ι
hτ : IsStoppingTime f τ
i : ι
this : {ω | τ ω = i} = {ω | τ ω ≤ i} ∩ {ω | τ ω ≥ i}
⊢ MeasurableSet ({ω | τ ω ≤ i} ∩ {ω | τ ω ≥ i})

Next tactic:
exact (hτ.measurableSet_le i).inter (hτ.measurableSet_ge i)
theorem isStoppingTime_of_measurableSet_eq [Preorder ι] [Countable ι] {f : Filtration ι m}
    {τ : Ω → ι} (hτ : ∀ i, MeasurableSet[f i] {ω | τ ω = i}) : IsStoppingTime f τ := by
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝¹ : Preorder ι
inst✝ : Countable ι
f : Filtration ι m
τ : Ω → ι
hτ : ∀ (i : ι), MeasurableSet {ω | τ ω = i}
⊢ IsStoppingTime f τ

Next tactic:
intro i
theorem isStoppingTime_of_measurableSet_eq [Preorder ι] [Countable ι] {f : Filtration ι m}
    {τ : Ω → ι} (hτ : ∀ i, MeasurableSet[f i] {ω | τ ω = i}) : IsStoppingTime f τ := by
  intro i
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝¹ : Preorder ι
inst✝ : Countable ι
f : Filtration ι m
τ : Ω → ι
hτ : ∀ (i : ι), MeasurableSet {ω | τ ω = i}
i : ι
⊢ MeasurableSet {ω | τ ω ≤ i}

Next tactic:
rw [show {ω | τ ω ≤ i} = ⋃ k ≤ i, {ω | τ ω = k} by ext; simp]
theorem isStoppingTime_of_measurableSet_eq [Preorder ι] [Countable ι] {f : Filtration ι m}
    {τ : Ω → ι} (hτ : ∀ i, MeasurableSet[f i] {ω | τ ω = i}) : IsStoppingTime f τ := by
  intro i
  rw [show {ω | τ ω ≤ i} = ⋃ k ≤ i, {ω | τ ω = k} by 

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝¹ : Preorder ι
inst✝ : Countable ι
f : Filtration ι m
τ : Ω → ι
hτ : ∀ (i : ι), MeasurableSet {ω | τ ω = i}
i : ι
⊢ {ω | τ ω ≤ i} = ⋃ k, ⋃ (_ : k ≤ i), {ω | τ ω = k}

Next tactic:
ext
theorem isStoppingTime_of_measurableSet_eq [Preorder ι] [Countable ι] {f : Filtration ι m}
    {τ : Ω → ι} (hτ : ∀ i, MeasurableSet[f i] {ω | τ ω = i}) : IsStoppingTime f τ := by
  intro i
  rw [show {ω | τ ω ≤ i} = ⋃ k ≤ i, {ω | τ ω = k} by ext; 

Proof state:
case h
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝¹ : Preorder ι
inst✝ : Countable ι
f : Filtration ι m
τ : Ω → ι
hτ : ∀ (i : ι), MeasurableSet {ω | τ ω = i}
i : ι
x✝ : Ω
⊢ x✝ ∈ {ω | τ ω ≤ i} ↔ x✝ ∈ ⋃ k, ⋃ (_ : k ≤ i), {ω | τ ω = k}

Next tactic:
simp
theorem isStoppingTime_of_measurableSet_eq [Preorder ι] [Countable ι] {f : Filtration ι m}
    {τ : Ω → ι} (hτ : ∀ i, MeasurableSet[f i] {ω | τ ω = i}) : IsStoppingTime f τ := by
  intro i
  rw [show {ω | τ ω ≤ i} = ⋃ k ≤ i, {ω | τ ω = k} by ext; simp]
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝¹ : Preorder ι
inst✝ : Countable ι
f : Filtration ι m
τ : Ω → ι
hτ : ∀ (i : ι), MeasurableSet {ω | τ ω = i}
i : ι
⊢ MeasurableSet (⋃ k, ⋃ (_ : k ≤ i), {ω | τ ω = k})

Next tactic:
refine' MeasurableSet.biUnion (Set.to_countable _) fun k hk => _
theorem isStoppingTime_of_measurableSet_eq [Preorder ι] [Countable ι] {f : Filtration ι m}
    {τ : Ω → ι} (hτ : ∀ i, MeasurableSet[f i] {ω | τ ω = i}) : IsStoppingTime f τ := by
  intro i
  rw [show {ω | τ ω ≤ i} = ⋃ k ≤ i, {ω | τ ω = k} by ext; simp]
  refine' MeasurableSet.biUnion (Set.to_countable _) fun k hk => _
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝¹ : Preorder ι
inst✝ : Countable ι
f : Filtration ι m
τ : Ω → ι
hτ : ∀ (i : ι), MeasurableSet {ω | τ ω = i}
i k : ι
hk : k ∈ fun k => Preorder.toLE.1 k i
⊢ MeasurableSet {ω | τ ω = k}

Next tactic:
exact f.mono hk _ (hτ k)
protected theorem max [LinearOrder ι] {f : Filtration ι m} {τ π : Ω → ι} (hτ : IsStoppingTime f τ)
    (hπ : IsStoppingTime f π) : IsStoppingTime f fun ω => max (τ ω) (π ω) := by
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝ : LinearOrder ι
f : Filtration ι m
τ π : Ω → ι
hτ : IsStoppingTime f τ
hπ : IsStoppingTime f π
⊢ IsStoppingTime f fun ω => max (τ ω) (π ω)

Next tactic:
intro i
protected theorem max [LinearOrder ι] {f : Filtration ι m} {τ π : Ω → ι} (hτ : IsStoppingTime f τ)
    (hπ : IsStoppingTime f π) : IsStoppingTime f fun ω => max (τ ω) (π ω) := by
  intro i
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝ : LinearOrder ι
f : Filtration ι m
τ π : Ω → ι
hτ : IsStoppingTime f τ
hπ : IsStoppingTime f π
i : ι
⊢ MeasurableSet {ω | (fun ω => max (τ ω) (π ω)) ω ≤ i}

Next tactic:
simp_rw [max_le_iff, Set.setOf_and]
protected theorem max [LinearOrder ι] {f : Filtration ι m} {τ π : Ω → ι} (hτ : IsStoppingTime f τ)
    (hπ : IsStoppingTime f π) : IsStoppingTime f fun ω => max (τ ω) (π ω) := by
  intro i
  simp_rw [max_le_iff, Set.setOf_and]
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝ : LinearOrder ι
f : Filtration ι m
τ π : Ω → ι
hτ : IsStoppingTime f τ
hπ : IsStoppingTime f π
i : ι
⊢ MeasurableSet ({a | τ a ≤ i} ∩ {a | π a ≤ i})

Next tactic:
exact (hτ i).inter (hπ i)
protected theorem min [LinearOrder ι] {f : Filtration ι m} {τ π : Ω → ι} (hτ : IsStoppingTime f τ)
    (hπ : IsStoppingTime f π) : IsStoppingTime f fun ω => min (τ ω) (π ω) := by
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝ : LinearOrder ι
f : Filtration ι m
τ π : Ω → ι
hτ : IsStoppingTime f τ
hπ : IsStoppingTime f π
⊢ IsStoppingTime f fun ω => min (τ ω) (π ω)

Next tactic:
intro i
protected theorem min [LinearOrder ι] {f : Filtration ι m} {τ π : Ω → ι} (hτ : IsStoppingTime f τ)
    (hπ : IsStoppingTime f π) : IsStoppingTime f fun ω => min (τ ω) (π ω) := by
  intro i
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝ : LinearOrder ι
f : Filtration ι m
τ π : Ω → ι
hτ : IsStoppingTime f τ
hπ : IsStoppingTime f π
i : ι
⊢ MeasurableSet {ω | (fun ω => min (τ ω) (π ω)) ω ≤ i}

Next tactic:
simp_rw [min_le_iff, Set.setOf_or]
protected theorem min [LinearOrder ι] {f : Filtration ι m} {τ π : Ω → ι} (hτ : IsStoppingTime f τ)
    (hπ : IsStoppingTime f π) : IsStoppingTime f fun ω => min (τ ω) (π ω) := by
  intro i
  simp_rw [min_le_iff, Set.setOf_or]
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝ : LinearOrder ι
f : Filtration ι m
τ π : Ω → ι
hτ : IsStoppingTime f τ
hπ : IsStoppingTime f π
i : ι
⊢ MeasurableSet ({a | τ a ≤ i} ∪ {a | π a ≤ i})

Next tactic:
exact (hτ i).union (hπ i)
theorem add_const [AddGroup ι] [Preorder ι] [CovariantClass ι ι (Function.swap (· + ·)) (· ≤ ·)]
    [CovariantClass ι ι (· + ·) (· ≤ ·)] {f : Filtration ι m} {τ : Ω → ι} (hτ : IsStoppingTime f τ)
    {i : ι} (hi : 0 ≤ i) : IsStoppingTime f fun ω => τ ω + i := by
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝³ : AddGroup ι
inst✝² : Preorder ι
inst✝¹ : CovariantClass ι ι (Function.swap fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝ : CovariantClass ι ι (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
f : Filtration ι m
τ : Ω → ι
hτ : IsStoppingTime f τ
i : ι
hi : 0 ≤ i
⊢ IsStoppingTime f fun ω => τ ω + i

Next tactic:
intro j
theorem add_const [AddGroup ι] [Preorder ι] [CovariantClass ι ι (Function.swap (· + ·)) (· ≤ ·)]
    [CovariantClass ι ι (· + ·) (· ≤ ·)] {f : Filtration ι m} {τ : Ω → ι} (hτ : IsStoppingTime f τ)
    {i : ι} (hi : 0 ≤ i) : IsStoppingTime f fun ω => τ ω + i := by
  intro j
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝³ : AddGroup ι
inst✝² : Preorder ι
inst✝¹ : CovariantClass ι ι (Function.swap fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝ : CovariantClass ι ι (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
f : Filtration ι m
τ : Ω → ι
hτ : IsStoppingTime f τ
i : ι
hi : 0 ≤ i
j : ι
⊢ MeasurableSet {ω | (fun ω => τ ω + i) ω ≤ j}

Next tactic:
simp_rw [← le_sub_iff_add_le]
theorem add_const [AddGroup ι] [Preorder ι] [CovariantClass ι ι (Function.swap (· + ·)) (· ≤ ·)]
    [CovariantClass ι ι (· + ·) (· ≤ ·)] {f : Filtration ι m} {τ : Ω → ι} (hτ : IsStoppingTime f τ)
    {i : ι} (hi : 0 ≤ i) : IsStoppingTime f fun ω => τ ω + i := by
  intro j
  simp_rw [← le_sub_iff_add_le]
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝³ : AddGroup ι
inst✝² : Preorder ι
inst✝¹ : CovariantClass ι ι (Function.swap fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝ : CovariantClass ι ι (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
f : Filtration ι m
τ : Ω → ι
hτ : IsStoppingTime f τ
i : ι
hi : 0 ≤ i
j : ι
⊢ MeasurableSet {ω | τ ω ≤ j - i}

Next tactic:
exact f.mono (sub_le_self j hi) _ (hτ (j - i))
theorem add_const_nat {f : Filtration ℕ m} {τ : Ω → ℕ} (hτ : IsStoppingTime f τ) {i : ℕ} :
    IsStoppingTime f fun ω => τ ω + i := by
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
f : Filtration ℕ m
τ : Ω → ℕ
hτ : IsStoppingTime f τ
i : ℕ
⊢ IsStoppingTime f fun ω => τ ω + i

Next tactic:
refine' isStoppingTime_of_measurableSet_eq fun j => _
theorem add_const_nat {f : Filtration ℕ m} {τ : Ω → ℕ} (hτ : IsStoppingTime f τ) {i : ℕ} :
    IsStoppingTime f fun ω => τ ω + i := by
  refine' isStoppingTime_of_measurableSet_eq fun j => _
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
f : Filtration ℕ m
τ : Ω → ℕ
hτ : IsStoppingTime f τ
i j : ℕ
⊢ MeasurableSet {ω | τ ω + i = j}

Next tactic:
by_cases hij : i ≤ j
theorem add_const_nat {f : Filtration ℕ m} {τ : Ω → ℕ} (hτ : IsStoppingTime f τ) {i : ℕ} :
    IsStoppingTime f fun ω => τ ω + i := by
  refine' isStoppingTime_of_measurableSet_eq fun j => _
  by_cases hij : i ≤ j
  · 

Proof state:
case pos
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
f : Filtration ℕ m
τ : Ω → ℕ
hτ : IsStoppingTime f τ
i j : ℕ
hij : i ≤ j
⊢ MeasurableSet {ω | τ ω + i = j}

Next tactic:
simp_rw [eq_comm, ← Nat.sub_eq_iff_eq_add hij, eq_comm]
theorem add_const_nat {f : Filtration ℕ m} {τ : Ω → ℕ} (hτ : IsStoppingTime f τ) {i : ℕ} :
    IsStoppingTime f fun ω => τ ω + i := by
  refine' isStoppingTime_of_measurableSet_eq fun j => _
  by_cases hij : i ≤ j
  · simp_rw [eq_comm, ← Nat.sub_eq_iff_eq_add hij, eq_comm]
    

Proof state:
case pos
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
f : Filtration ℕ m
τ : Ω → ℕ
hτ : IsStoppingTime f τ
i j : ℕ
hij : i ≤ j
⊢ MeasurableSet {ω | τ ω = j - i}

Next tactic:
exact f.mono (j.sub_le i) _ (hτ.measurableSet_eq (j - i))
theorem add_const_nat {f : Filtration ℕ m} {τ : Ω → ℕ} (hτ : IsStoppingTime f τ) {i : ℕ} :
    IsStoppingTime f fun ω => τ ω + i := by
  refine' isStoppingTime_of_measurableSet_eq fun j => _
  by_cases hij : i ≤ j
  · simp_rw [eq_comm, ← Nat.sub_eq_iff_eq_add hij, eq_comm]
    exact f.mono (j.sub_le i) _ (hτ.measurableSet_eq (j - i))
  · 

Proof state:
case neg
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
f : Filtration ℕ m
τ : Ω → ℕ
hτ : IsStoppingTime f τ
i j : ℕ
hij : ¬i ≤ j
⊢ MeasurableSet {ω | τ ω + i = j}

Next tactic:
rw [not_le] at hij
theorem add_const_nat {f : Filtration ℕ m} {τ : Ω → ℕ} (hτ : IsStoppingTime f τ) {i : ℕ} :
    IsStoppingTime f fun ω => τ ω + i := by
  refine' isStoppingTime_of_measurableSet_eq fun j => _
  by_cases hij : i ≤ j
  · simp_rw [eq_comm, ← Nat.sub_eq_iff_eq_add hij, eq_comm]
    exact f.mono (j.sub_le i) _ (hτ.measurableSet_eq (j - i))
  · rw [not_le] at hij
    

Proof state:
case neg
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
f : Filtration ℕ m
τ : Ω → ℕ
hτ : IsStoppingTime f τ
i j : ℕ
hij : j < i
⊢ MeasurableSet {ω | τ ω + i = j}

Next tactic:
convert @MeasurableSet.empty _ (f.1 j)
theorem add_const_nat {f : Filtration ℕ m} {τ : Ω → ℕ} (hτ : IsStoppingTime f τ) {i : ℕ} :
    IsStoppingTime f fun ω => τ ω + i := by
  refine' isStoppingTime_of_measurableSet_eq fun j => _
  by_cases hij : i ≤ j
  · simp_rw [eq_comm, ← Nat.sub_eq_iff_eq_add hij, eq_comm]
    exact f.mono (j.sub_le i) _ (hτ.measurableSet_eq (j - i))
  · rw [not_le] at hij
    convert @MeasurableSet.empty _ (f.1 j)
    

Proof state:
case h.e'_3
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
f : Filtration ℕ m
τ : Ω → ℕ
hτ : IsStoppingTime f τ
i j : ℕ
hij : j < i
⊢ {ω | τ ω + i = j} = ∅

Next tactic:
ext ω
theorem add_const_nat {f : Filtration ℕ m} {τ : Ω → ℕ} (hτ : IsStoppingTime f τ) {i : ℕ} :
    IsStoppingTime f fun ω => τ ω + i := by
  refine' isStoppingTime_of_measurableSet_eq fun j => _
  by_cases hij : i ≤ j
  · simp_rw [eq_comm, ← Nat.sub_eq_iff_eq_add hij, eq_comm]
    exact f.mono (j.sub_le i) _ (hτ.measurableSet_eq (j - i))
  · rw [not_le] at hij
    convert @MeasurableSet.empty _ (f.1 j)
    ext ω
    

Proof state:
case h.e'_3.h
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
f : Filtration ℕ m
τ : Ω → ℕ
hτ : IsStoppingTime f τ
i j : ℕ
hij : j < i
ω : Ω
⊢ ω ∈ {ω | τ ω + i = j} ↔ ω ∈ ∅

Next tactic:
simp only [Set.mem_empty_iff_false, iff_false_iff]
theorem add_const_nat {f : Filtration ℕ m} {τ : Ω → ℕ} (hτ : IsStoppingTime f τ) {i : ℕ} :
    IsStoppingTime f fun ω => τ ω + i := by
  refine' isStoppingTime_of_measurableSet_eq fun j => _
  by_cases hij : i ≤ j
  · simp_rw [eq_comm, ← Nat.sub_eq_iff_eq_add hij, eq_comm]
    exact f.mono (j.sub_le i) _ (hτ.measurableSet_eq (j - i))
  · rw [not_le] at hij
    convert @MeasurableSet.empty _ (f.1 j)
    ext ω
    simp only [Set.mem_empty_iff_false, iff_false_iff]
    

Proof state:
case h.e'_3.h
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
f : Filtration ℕ m
τ : Ω → ℕ
hτ : IsStoppingTime f τ
i j : ℕ
hij : j < i
ω : Ω
⊢ ω ∉ {ω | τ ω + i = j}

Next tactic:
rintro (hx : τ ω + i = j)
theorem add_const_nat {f : Filtration ℕ m} {τ : Ω → ℕ} (hτ : IsStoppingTime f τ) {i : ℕ} :
    IsStoppingTime f fun ω => τ ω + i := by
  refine' isStoppingTime_of_measurableSet_eq fun j => _
  by_cases hij : i ≤ j
  · simp_rw [eq_comm, ← Nat.sub_eq_iff_eq_add hij, eq_comm]
    exact f.mono (j.sub_le i) _ (hτ.measurableSet_eq (j - i))
  · rw [not_le] at hij
    convert @MeasurableSet.empty _ (f.1 j)
    ext ω
    simp only [Set.mem_empty_iff_false, iff_false_iff]
    rintro (hx : τ ω + i = j)
    

Proof state:
case h.e'_3.h
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
f : Filtration ℕ m
τ : Ω → ℕ
hτ : IsStoppingTime f τ
i j : ℕ
hij : j < i
ω : Ω
hx : τ ω + i = j
⊢ False

Next tactic:
linarith
theorem add {f : Filtration ℕ m} {τ π : Ω → ℕ} (hτ : IsStoppingTime f τ) (hπ : IsStoppingTime f π) :
    IsStoppingTime f (τ + π) := by
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
f : Filtration ℕ m
τ π : Ω → ℕ
hτ : IsStoppingTime f τ
hπ : IsStoppingTime f π
⊢ IsStoppingTime f (τ + π)

Next tactic:
intro i
theorem add {f : Filtration ℕ m} {τ π : Ω → ℕ} (hτ : IsStoppingTime f τ) (hπ : IsStoppingTime f π) :
    IsStoppingTime f (τ + π) := by
  intro i
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
f : Filtration ℕ m
τ π : Ω → ℕ
hτ : IsStoppingTime f τ
hπ : IsStoppingTime f π
i : ℕ
⊢ MeasurableSet {ω | (τ + π) ω ≤ i}

Next tactic:
rw [(_ : {ω | (τ + π) ω ≤ i} = ⋃ k ≤ i, {ω | π ω = k} ∩ {ω | τ ω + k ≤ i})]
theorem add {f : Filtration ℕ m} {τ π : Ω → ℕ} (hτ : IsStoppingTime f τ) (hπ : IsStoppingTime f π) :
    IsStoppingTime f (τ + π) := by
  intro i
  rw [(_ : {ω | (τ + π) ω ≤ i} = ⋃ k ≤ i, {ω | π ω = k} ∩ {ω | τ ω + k ≤ i})]
  · 

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
f : Filtration ℕ m
τ π : Ω → ℕ
hτ : IsStoppingTime f τ
hπ : IsStoppingTime f π
i : ℕ
⊢ MeasurableSet (⋃ k, ⋃ (_ : k ≤ i), {ω | π ω = k} ∩ {ω | τ ω + k ≤ i})

Next tactic:
exact MeasurableSet.iUnion fun k =>
      MeasurableSet.iUnion fun hk => (hπ.measurableSet_eq_le hk).inter (hτ.add_const_nat i)
theorem add {f : Filtration ℕ m} {τ π : Ω → ℕ} (hτ : IsStoppingTime f τ) (hπ : IsStoppingTime f π) :
    IsStoppingTime f (τ + π) := by
  intro i
  rw [(_ : {ω | (τ + π) ω ≤ i} = ⋃ k ≤ i, {ω | π ω = k} ∩ {ω | τ ω + k ≤ i})]
  · exact MeasurableSet.iUnion fun k =>
      MeasurableSet.iUnion fun hk => (hπ.measurableSet_eq_le hk).inter (hτ.add_const_nat i)
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
f : Filtration ℕ m
τ π : Ω → ℕ
hτ : IsStoppingTime f τ
hπ : IsStoppingTime f π
i : ℕ
⊢ {ω | (τ + π) ω ≤ i} = ⋃ k, ⋃ (_ : k ≤ i), {ω | π ω = k} ∩ {ω | τ ω + k ≤ i}

Next tactic:
ext ω
theorem add {f : Filtration ℕ m} {τ π : Ω → ℕ} (hτ : IsStoppingTime f τ) (hπ : IsStoppingTime f π) :
    IsStoppingTime f (τ + π) := by
  intro i
  rw [(_ : {ω | (τ + π) ω ≤ i} = ⋃ k ≤ i, {ω | π ω = k} ∩ {ω | τ ω + k ≤ i})]
  · exact MeasurableSet.iUnion fun k =>
      MeasurableSet.iUnion fun hk => (hπ.measurableSet_eq_le hk).inter (hτ.add_const_nat i)
  ext ω
  

Proof state:
case h
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
f : Filtration ℕ m
τ π : Ω → ℕ
hτ : IsStoppingTime f τ
hπ : IsStoppingTime f π
i : ℕ
ω : Ω
⊢ ω ∈ {ω | (τ + π) ω ≤ i} ↔ ω ∈ ⋃ k, ⋃ (_ : k ≤ i), {ω | π ω = k} ∩ {ω | τ ω + k ≤ i}

Next tactic:
simp only [Pi.add_apply, Set.mem_setOf_eq, Set.mem_iUnion, Set.mem_inter_iff, exists_prop]
theorem add {f : Filtration ℕ m} {τ π : Ω → ℕ} (hτ : IsStoppingTime f τ) (hπ : IsStoppingTime f π) :
    IsStoppingTime f (τ + π) := by
  intro i
  rw [(_ : {ω | (τ + π) ω ≤ i} = ⋃ k ≤ i, {ω | π ω = k} ∩ {ω | τ ω + k ≤ i})]
  · exact MeasurableSet.iUnion fun k =>
      MeasurableSet.iUnion fun hk => (hπ.measurableSet_eq_le hk).inter (hτ.add_const_nat i)
  ext ω
  simp only [Pi.add_apply, Set.mem_setOf_eq, Set.mem_iUnion, Set.mem_inter_iff, exists_prop]
  

Proof state:
case h
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
f : Filtration ℕ m
τ π : Ω → ℕ
hτ : IsStoppingTime f τ
hπ : IsStoppingTime f π
i : ℕ
ω : Ω
⊢ τ ω + π ω ≤ i ↔ ∃ i_1 ≤ i, π ω = i_1 ∧ τ ω + i_1 ≤ i

Next tactic:
refine' ⟨fun h => ⟨π ω, by linarith, rfl, h⟩, _⟩
theorem add {f : Filtration ℕ m} {τ π : Ω → ℕ} (hτ : IsStoppingTime f τ) (hπ : IsStoppingTime f π) :
    IsStoppingTime f (τ + π) := by
  intro i
  rw [(_ : {ω | (τ + π) ω ≤ i} = ⋃ k ≤ i, {ω | π ω = k} ∩ {ω | τ ω + k ≤ i})]
  · exact MeasurableSet.iUnion fun k =>
      MeasurableSet.iUnion fun hk => (hπ.measurableSet_eq_le hk).inter (hτ.add_const_nat i)
  ext ω
  simp only [Pi.add_apply, Set.mem_setOf_eq, Set.mem_iUnion, Set.mem_inter_iff, exists_prop]
  refine' ⟨fun h => ⟨π ω, by 

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
f : Filtration ℕ m
τ π : Ω → ℕ
hτ : IsStoppingTime f τ
hπ : IsStoppingTime f π
i : ℕ
ω : Ω
h : τ ω + π ω ≤ i
⊢ π ω ≤ i

Next tactic:
linarith
theorem add {f : Filtration ℕ m} {τ π : Ω → ℕ} (hτ : IsStoppingTime f τ) (hπ : IsStoppingTime f π) :
    IsStoppingTime f (τ + π) := by
  intro i
  rw [(_ : {ω | (τ + π) ω ≤ i} = ⋃ k ≤ i, {ω | π ω = k} ∩ {ω | τ ω + k ≤ i})]
  · exact MeasurableSet.iUnion fun k =>
      MeasurableSet.iUnion fun hk => (hπ.measurableSet_eq_le hk).inter (hτ.add_const_nat i)
  ext ω
  simp only [Pi.add_apply, Set.mem_setOf_eq, Set.mem_iUnion, Set.mem_inter_iff, exists_prop]
  refine' ⟨fun h => ⟨π ω, by linarith, rfl, h⟩, _⟩
  

Proof state:
case h
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
f : Filtration ℕ m
τ π : Ω → ℕ
hτ : IsStoppingTime f τ
hπ : IsStoppingTime f π
i : ℕ
ω : Ω
⊢ (∃ i_1 ≤ i, π ω = i_1 ∧ τ ω + i_1 ≤ i) → τ ω + π ω ≤ i

Next tactic:
rintro ⟨j, hj, rfl, h⟩