l3lab/ntp-mathlib huggingface dataset:
theorem IsStoppingTime.measurableSet_lt_of_pred [PredOrder ι] (hτ : IsStoppingTime f τ) (i : ι) :
    MeasurableSet[f i] {ω | τ ω < i} := by
  by_cases hi_min : IsMin i
  · suffices {ω : Ω | τ ω < i} = ∅ by rw [this]; exact @MeasurableSet.empty _ (f i)
    ext1 ω
    simp only [Set.mem_setOf_eq, Set.mem_empty_iff_false, iff_false_iff]
    

Proof state:
case pos.h
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝¹ : Preorder ι
f : Filtration ι m
τ : Ω → ι
inst✝ : PredOrder ι
hτ : IsStoppingTime f τ
i : ι
hi_min : IsMin i
ω : Ω
⊢ ¬τ ω < i

Next tactic:
rw [isMin_iff_forall_not_lt] at hi_min
theorem IsStoppingTime.measurableSet_lt_of_pred [PredOrder ι] (hτ : IsStoppingTime f τ) (i : ι) :
    MeasurableSet[f i] {ω | τ ω < i} := by
  by_cases hi_min : IsMin i
  · suffices {ω : Ω | τ ω < i} = ∅ by rw [this]; exact @MeasurableSet.empty _ (f i)
    ext1 ω
    simp only [Set.mem_setOf_eq, Set.mem_empty_iff_false, iff_false_iff]
    rw [isMin_iff_forall_not_lt] at hi_min
    

Proof state:
case pos.h
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝¹ : Preorder ι
f : Filtration ι m
τ : Ω → ι
inst✝ : PredOrder ι
hτ : IsStoppingTime f τ
i : ι
hi_min : ∀ (b : ι), ¬b < i
ω : Ω
⊢ ¬τ ω < i

Next tactic:
exact hi_min (τ ω)
theorem IsStoppingTime.measurableSet_lt_of_pred [PredOrder ι] (hτ : IsStoppingTime f τ) (i : ι) :
    MeasurableSet[f i] {ω | τ ω < i} := by
  by_cases hi_min : IsMin i
  · suffices {ω : Ω | τ ω < i} = ∅ by rw [this]; exact @MeasurableSet.empty _ (f i)
    ext1 ω
    simp only [Set.mem_setOf_eq, Set.mem_empty_iff_false, iff_false_iff]
    rw [isMin_iff_forall_not_lt] at hi_min
    exact hi_min (τ ω)
  

Proof state:
case neg
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝¹ : Preorder ι
f : Filtration ι m
τ : Ω → ι
inst✝ : PredOrder ι
hτ : IsStoppingTime f τ
i : ι
hi_min : ¬IsMin i
⊢ MeasurableSet {ω | τ ω < i}

Next tactic:
have : {ω : Ω | τ ω < i} = τ ⁻¹' Set.Iio i := rfl
theorem IsStoppingTime.measurableSet_lt_of_pred [PredOrder ι] (hτ : IsStoppingTime f τ) (i : ι) :
    MeasurableSet[f i] {ω | τ ω < i} := by
  by_cases hi_min : IsMin i
  · suffices {ω : Ω | τ ω < i} = ∅ by rw [this]; exact @MeasurableSet.empty _ (f i)
    ext1 ω
    simp only [Set.mem_setOf_eq, Set.mem_empty_iff_false, iff_false_iff]
    rw [isMin_iff_forall_not_lt] at hi_min
    exact hi_min (τ ω)
  have : {ω : Ω | τ ω < i} = τ ⁻¹' Set.Iio i := rfl
  

Proof state:
case neg
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝¹ : Preorder ι
f : Filtration ι m
τ : Ω → ι
inst✝ : PredOrder ι
hτ : IsStoppingTime f τ
i : ι
hi_min : ¬IsMin i
this : {ω | τ ω < i} = τ ⁻¹' Set.Iio i
⊢ MeasurableSet {ω | τ ω < i}

Next tactic:
rw [this, ← Iic_pred_of_not_isMin hi_min]
theorem IsStoppingTime.measurableSet_lt_of_pred [PredOrder ι] (hτ : IsStoppingTime f τ) (i : ι) :
    MeasurableSet[f i] {ω | τ ω < i} := by
  by_cases hi_min : IsMin i
  · suffices {ω : Ω | τ ω < i} = ∅ by rw [this]; exact @MeasurableSet.empty _ (f i)
    ext1 ω
    simp only [Set.mem_setOf_eq, Set.mem_empty_iff_false, iff_false_iff]
    rw [isMin_iff_forall_not_lt] at hi_min
    exact hi_min (τ ω)
  have : {ω : Ω | τ ω < i} = τ ⁻¹' Set.Iio i := rfl
  rw [this, ← Iic_pred_of_not_isMin hi_min]
  

Proof state:
case neg
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝¹ : Preorder ι
f : Filtration ι m
τ : Ω → ι
inst✝ : PredOrder ι
hτ : IsStoppingTime f τ
i : ι
hi_min : ¬IsMin i
this : {ω | τ ω < i} = τ ⁻¹' Set.Iio i
⊢ MeasurableSet (τ ⁻¹' Set.Iic (pred i))

Next tactic:
exact f.mono (pred_le i) _ (hτ.measurableSet_le <| pred i)
protected theorem measurableSet_eq_of_countable_range (hτ : IsStoppingTime f τ)
    (h_countable : (Set.range τ).Countable) (i : ι) : MeasurableSet[f i] {ω | τ ω = i} := by
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝ : PartialOrder ι
τ : Ω → ι
f : Filtration ι m
hτ : IsStoppingTime f τ
h_countable : Set.Countable (Set.range τ)
i : ι
⊢ MeasurableSet {ω | τ ω = i}

Next tactic:
have : {ω | τ ω = i} = {ω | τ ω ≤ i} \ ⋃ (j ∈ Set.range τ) (_ : j < i), {ω | τ ω ≤ j} := by
    ext1 a
    simp only [Set.mem_setOf_eq, Set.mem_range, Set.iUnion_exists, Set.iUnion_iUnion_eq',
      Set.mem_diff, Set.mem_iUnion, exists_prop, not_exists, not_and, not_le]
    constructor <;> intro h
    · simp only [h, lt_iff_le_not_le, le_refl, and_imp, imp_self, imp_true_iff, and_self_iff]
    · have h_lt_or_eq : τ a < i ∨ τ a = i := lt_or_eq_of_le h.1
      rcases h_lt_or_eq with (h_lt | rfl)
      · exfalso
        exact h.2 a h_lt (le_refl (τ a))
      · rfl
protected theorem measurableSet_eq_of_countable_range (hτ : IsStoppingTime f τ)
    (h_countable : (Set.range τ).Countable) (i : ι) : MeasurableSet[f i] {ω | τ ω = i} := by
  have : {ω | τ ω = i} = {ω | τ ω ≤ i} \ ⋃ (j ∈ Set.range τ) (_ : j < i), {ω | τ ω ≤ j} := by
    

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝ : PartialOrder ι
τ : Ω → ι
f : Filtration ι m
hτ : IsStoppingTime f τ
h_countable : Set.Countable (Set.range τ)
i : ι
⊢ {ω | τ ω = i} = {ω | τ ω ≤ i} \ ⋃ j ∈ Set.range τ, ⋃ (_ : j < i), {ω | τ ω ≤ j}

Next tactic:
ext1 a
protected theorem measurableSet_eq_of_countable_range (hτ : IsStoppingTime f τ)
    (h_countable : (Set.range τ).Countable) (i : ι) : MeasurableSet[f i] {ω | τ ω = i} := by
  have : {ω | τ ω = i} = {ω | τ ω ≤ i} \ ⋃ (j ∈ Set.range τ) (_ : j < i), {ω | τ ω ≤ j} := by
    ext1 a
    

Proof state:
case h
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝ : PartialOrder ι
τ : Ω → ι
f : Filtration ι m
hτ : IsStoppingTime f τ
h_countable : Set.Countable (Set.range τ)
i : ι
a : Ω
⊢ a ∈ {ω | τ ω = i} ↔ a ∈ {ω | τ ω ≤ i} \ ⋃ j ∈ Set.range τ, ⋃ (_ : j < i), {ω | τ ω ≤ j}

Next tactic:
simp only [Set.mem_setOf_eq, Set.mem_range, Set.iUnion_exists, Set.iUnion_iUnion_eq',
      Set.mem_diff, Set.mem_iUnion, exists_prop, not_exists, not_and, not_le]
protected theorem measurableSet_eq_of_countable_range (hτ : IsStoppingTime f τ)
    (h_countable : (Set.range τ).Countable) (i : ι) : MeasurableSet[f i] {ω | τ ω = i} := by
  have : {ω | τ ω = i} = {ω | τ ω ≤ i} \ ⋃ (j ∈ Set.range τ) (_ : j < i), {ω | τ ω ≤ j} := by
    ext1 a
    simp only [Set.mem_setOf_eq, Set.mem_range, Set.iUnion_exists, Set.iUnion_iUnion_eq',
      Set.mem_diff, Set.mem_iUnion, exists_prop, not_exists, not_and, not_le]
    

Proof state:
case h
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝ : PartialOrder ι
τ : Ω → ι
f : Filtration ι m
hτ : IsStoppingTime f τ
h_countable : Set.Countable (Set.range τ)
i : ι
a : Ω
⊢ τ a = i ↔ τ a ≤ i ∧ ∀ (x : Ω), τ x < i → ¬τ a ≤ τ x

Next tactic:
constructor
protected theorem measurableSet_eq_of_countable_range (hτ : IsStoppingTime f τ)
    (h_countable : (Set.range τ).Countable) (i : ι) : MeasurableSet[f i] {ω | τ ω = i} := by
  have : {ω | τ ω = i} = {ω | τ ω ≤ i} \ ⋃ (j ∈ Set.range τ) (_ : j < i), {ω | τ ω ≤ j} := by
    ext1 a
    simp only [Set.mem_setOf_eq, Set.mem_range, Set.iUnion_exists, Set.iUnion_iUnion_eq',
      Set.mem_diff, Set.mem_iUnion, exists_prop, not_exists, not_and, not_le]
    constructor <;> 

Proof state:
case h.mp
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝ : PartialOrder ι
τ : Ω → ι
f : Filtration ι m
hτ : IsStoppingTime f τ
h_countable : Set.Countable (Set.range τ)
i : ι
a : Ω
⊢ τ a = i → τ a ≤ i ∧ ∀ (x : Ω), τ x < i → ¬τ a ≤ τ x

Next tactic:
intro h
protected theorem measurableSet_eq_of_countable_range (hτ : IsStoppingTime f τ)
    (h_countable : (Set.range τ).Countable) (i : ι) : MeasurableSet[f i] {ω | τ ω = i} := by
  have : {ω | τ ω = i} = {ω | τ ω ≤ i} \ ⋃ (j ∈ Set.range τ) (_ : j < i), {ω | τ ω ≤ j} := by
    ext1 a
    simp only [Set.mem_setOf_eq, Set.mem_range, Set.iUnion_exists, Set.iUnion_iUnion_eq',
      Set.mem_diff, Set.mem_iUnion, exists_prop, not_exists, not_and, not_le]
    constructor <;> 

Proof state:
case h.mpr
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝ : PartialOrder ι
τ : Ω → ι
f : Filtration ι m
hτ : IsStoppingTime f τ
h_countable : Set.Countable (Set.range τ)
i : ι
a : Ω
⊢ (τ a ≤ i ∧ ∀ (x : Ω), τ x < i → ¬τ a ≤ τ x) → τ a = i

Next tactic:
intro h
protected theorem measurableSet_eq_of_countable_range (hτ : IsStoppingTime f τ)
    (h_countable : (Set.range τ).Countable) (i : ι) : MeasurableSet[f i] {ω | τ ω = i} := by
  have : {ω | τ ω = i} = {ω | τ ω ≤ i} \ ⋃ (j ∈ Set.range τ) (_ : j < i), {ω | τ ω ≤ j} := by
    ext1 a
    simp only [Set.mem_setOf_eq, Set.mem_range, Set.iUnion_exists, Set.iUnion_iUnion_eq',
      Set.mem_diff, Set.mem_iUnion, exists_prop, not_exists, not_and, not_le]
    constructor <;> intro h
    · 

Proof state:
case h.mp
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝ : PartialOrder ι
τ : Ω → ι
f : Filtration ι m
hτ : IsStoppingTime f τ
h_countable : Set.Countable (Set.range τ)
i : ι
a : Ω
h : τ a = i
⊢ τ a ≤ i ∧ ∀ (x : Ω), τ x < i → ¬τ a ≤ τ x

Next tactic:
simp only [h, lt_iff_le_not_le, le_refl, and_imp, imp_self, imp_true_iff, and_self_iff]
protected theorem measurableSet_eq_of_countable_range (hτ : IsStoppingTime f τ)
    (h_countable : (Set.range τ).Countable) (i : ι) : MeasurableSet[f i] {ω | τ ω = i} := by
  have : {ω | τ ω = i} = {ω | τ ω ≤ i} \ ⋃ (j ∈ Set.range τ) (_ : j < i), {ω | τ ω ≤ j} := by
    ext1 a
    simp only [Set.mem_setOf_eq, Set.mem_range, Set.iUnion_exists, Set.iUnion_iUnion_eq',
      Set.mem_diff, Set.mem_iUnion, exists_prop, not_exists, not_and, not_le]
    constructor <;> intro h
    · simp only [h, lt_iff_le_not_le, le_refl, and_imp, imp_self, imp_true_iff, and_self_iff]
    · 

Proof state:
case h.mpr
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝ : PartialOrder ι
τ : Ω → ι
f : Filtration ι m
hτ : IsStoppingTime f τ
h_countable : Set.Countable (Set.range τ)
i : ι
a : Ω
h : τ a ≤ i ∧ ∀ (x : Ω), τ x < i → ¬τ a ≤ τ x
⊢ τ a = i

Next tactic:
have h_lt_or_eq : τ a < i ∨ τ a = i := lt_or_eq_of_le h.1
protected theorem measurableSet_eq_of_countable_range (hτ : IsStoppingTime f τ)
    (h_countable : (Set.range τ).Countable) (i : ι) : MeasurableSet[f i] {ω | τ ω = i} := by
  have : {ω | τ ω = i} = {ω | τ ω ≤ i} \ ⋃ (j ∈ Set.range τ) (_ : j < i), {ω | τ ω ≤ j} := by
    ext1 a
    simp only [Set.mem_setOf_eq, Set.mem_range, Set.iUnion_exists, Set.iUnion_iUnion_eq',
      Set.mem_diff, Set.mem_iUnion, exists_prop, not_exists, not_and, not_le]
    constructor <;> intro h
    · simp only [h, lt_iff_le_not_le, le_refl, and_imp, imp_self, imp_true_iff, and_self_iff]
    · have h_lt_or_eq : τ a < i ∨ τ a = i := lt_or_eq_of_le h.1
      

Proof state:
case h.mpr
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝ : PartialOrder ι
τ : Ω → ι
f : Filtration ι m
hτ : IsStoppingTime f τ
h_countable : Set.Countable (Set.range τ)
i : ι
a : Ω
h : τ a ≤ i ∧ ∀ (x : Ω), τ x < i → ¬τ a ≤ τ x
h_lt_or_eq : τ a < i ∨ τ a = i
⊢ τ a = i

Next tactic:
rcases h_lt_or_eq with (h_lt | rfl)
protected theorem measurableSet_eq_of_countable_range (hτ : IsStoppingTime f τ)
    (h_countable : (Set.range τ).Countable) (i : ι) : MeasurableSet[f i] {ω | τ ω = i} := by
  have : {ω | τ ω = i} = {ω | τ ω ≤ i} \ ⋃ (j ∈ Set.range τ) (_ : j < i), {ω | τ ω ≤ j} := by
    ext1 a
    simp only [Set.mem_setOf_eq, Set.mem_range, Set.iUnion_exists, Set.iUnion_iUnion_eq',
      Set.mem_diff, Set.mem_iUnion, exists_prop, not_exists, not_and, not_le]
    constructor <;> intro h
    · simp only [h, lt_iff_le_not_le, le_refl, and_imp, imp_self, imp_true_iff, and_self_iff]
    · have h_lt_or_eq : τ a < i ∨ τ a = i := lt_or_eq_of_le h.1
      rcases h_lt_or_eq with (h_lt | rfl)
      · 

Proof state:
case h.mpr.inl
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝ : PartialOrder ι
τ : Ω → ι
f : Filtration ι m
hτ : IsStoppingTime f τ
h_countable : Set.Countable (Set.range τ)
i : ι
a : Ω
h : τ a ≤ i ∧ ∀ (x : Ω), τ x < i → ¬τ a ≤ τ x
h_lt : τ a < i
⊢ τ a = i

Next tactic:
exfalso
protected theorem measurableSet_eq_of_countable_range (hτ : IsStoppingTime f τ)
    (h_countable : (Set.range τ).Countable) (i : ι) : MeasurableSet[f i] {ω | τ ω = i} := by
  have : {ω | τ ω = i} = {ω | τ ω ≤ i} \ ⋃ (j ∈ Set.range τ) (_ : j < i), {ω | τ ω ≤ j} := by
    ext1 a
    simp only [Set.mem_setOf_eq, Set.mem_range, Set.iUnion_exists, Set.iUnion_iUnion_eq',
      Set.mem_diff, Set.mem_iUnion, exists_prop, not_exists, not_and, not_le]
    constructor <;> intro h
    · simp only [h, lt_iff_le_not_le, le_refl, and_imp, imp_self, imp_true_iff, and_self_iff]
    · have h_lt_or_eq : τ a < i ∨ τ a = i := lt_or_eq_of_le h.1
      rcases h_lt_or_eq with (h_lt | rfl)
      · exfalso
        

Proof state:
case h.mpr.inl.h
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝ : PartialOrder ι
τ : Ω → ι
f : Filtration ι m
hτ : IsStoppingTime f τ
h_countable : Set.Countable (Set.range τ)
i : ι
a : Ω
h : τ a ≤ i ∧ ∀ (x : Ω), τ x < i → ¬τ a ≤ τ x
h_lt : τ a < i
⊢ False

Next tactic:
exact h.2 a h_lt (le_refl (τ a))
protected theorem measurableSet_eq_of_countable_range (hτ : IsStoppingTime f τ)
    (h_countable : (Set.range τ).Countable) (i : ι) : MeasurableSet[f i] {ω | τ ω = i} := by
  have : {ω | τ ω = i} = {ω | τ ω ≤ i} \ ⋃ (j ∈ Set.range τ) (_ : j < i), {ω | τ ω ≤ j} := by
    ext1 a
    simp only [Set.mem_setOf_eq, Set.mem_range, Set.iUnion_exists, Set.iUnion_iUnion_eq',
      Set.mem_diff, Set.mem_iUnion, exists_prop, not_exists, not_and, not_le]
    constructor <;> intro h
    · simp only [h, lt_iff_le_not_le, le_refl, and_imp, imp_self, imp_true_iff, and_self_iff]
    · have h_lt_or_eq : τ a < i ∨ τ a = i := lt_or_eq_of_le h.1
      rcases h_lt_or_eq with (h_lt | rfl)
      · exfalso
        exact h.2 a h_lt (le_refl (τ a))
      · 

Proof state:
case h.mpr.inr
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝ : PartialOrder ι
τ : Ω → ι
f : Filtration ι m
hτ : IsStoppingTime f τ
h_countable : Set.Countable (Set.range τ)
a : Ω
h : τ a ≤ τ a ∧ ∀ (x : Ω), τ x < τ a → ¬τ a ≤ τ x
⊢ τ a = τ a

Next tactic:
rfl
protected theorem measurableSet_eq_of_countable_range (hτ : IsStoppingTime f τ)
    (h_countable : (Set.range τ).Countable) (i : ι) : MeasurableSet[f i] {ω | τ ω = i} := by
  have : {ω | τ ω = i} = {ω | τ ω ≤ i} \ ⋃ (j ∈ Set.range τ) (_ : j < i), {ω | τ ω ≤ j} := by
    ext1 a
    simp only [Set.mem_setOf_eq, Set.mem_range, Set.iUnion_exists, Set.iUnion_iUnion_eq',
      Set.mem_diff, Set.mem_iUnion, exists_prop, not_exists, not_and, not_le]
    constructor <;> intro h
    · simp only [h, lt_iff_le_not_le, le_refl, and_imp, imp_self, imp_true_iff, and_self_iff]
    · have h_lt_or_eq : τ a < i ∨ τ a = i := lt_or_eq_of_le h.1
      rcases h_lt_or_eq with (h_lt | rfl)
      · exfalso
        exact h.2 a h_lt (le_refl (τ a))
      · rfl
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝ : PartialOrder ι
τ : Ω → ι
f : Filtration ι m
hτ : IsStoppingTime f τ
h_countable : Set.Countable (Set.range τ)
i : ι
this : {ω | τ ω = i} = {ω | τ ω ≤ i} \ ⋃ j ∈ Set.range τ, ⋃ (_ : j < i), {ω | τ ω ≤ j}
⊢ MeasurableSet {ω | τ ω = i}

Next tactic:
rw [this]
protected theorem measurableSet_eq_of_countable_range (hτ : IsStoppingTime f τ)
    (h_countable : (Set.range τ).Countable) (i : ι) : MeasurableSet[f i] {ω | τ ω = i} := by
  have : {ω | τ ω = i} = {ω | τ ω ≤ i} \ ⋃ (j ∈ Set.range τ) (_ : j < i), {ω | τ ω ≤ j} := by
    ext1 a
    simp only [Set.mem_setOf_eq, Set.mem_range, Set.iUnion_exists, Set.iUnion_iUnion_eq',
      Set.mem_diff, Set.mem_iUnion, exists_prop, not_exists, not_and, not_le]
    constructor <;> intro h
    · simp only [h, lt_iff_le_not_le, le_refl, and_imp, imp_self, imp_true_iff, and_self_iff]
    · have h_lt_or_eq : τ a < i ∨ τ a = i := lt_or_eq_of_le h.1
      rcases h_lt_or_eq with (h_lt | rfl)
      · exfalso
        exact h.2 a h_lt (le_refl (τ a))
      · rfl
  rw [this]
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝ : PartialOrder ι
τ : Ω → ι
f : Filtration ι m
hτ : IsStoppingTime f τ
h_countable : Set.Countable (Set.range τ)
i : ι
this : {ω | τ ω = i} = {ω | τ ω ≤ i} \ ⋃ j ∈ Set.range τ, ⋃ (_ : j < i), {ω | τ ω ≤ j}
⊢ MeasurableSet ({ω | τ ω ≤ i} \ ⋃ j ∈ Set.range τ, ⋃ (_ : j < i), {ω | τ ω ≤ j})

Next tactic:
refine' (hτ.measurableSet_le i).diff _
protected theorem measurableSet_eq_of_countable_range (hτ : IsStoppingTime f τ)
    (h_countable : (Set.range τ).Countable) (i : ι) : MeasurableSet[f i] {ω | τ ω = i} := by
  have : {ω | τ ω = i} = {ω | τ ω ≤ i} \ ⋃ (j ∈ Set.range τ) (_ : j < i), {ω | τ ω ≤ j} := by
    ext1 a
    simp only [Set.mem_setOf_eq, Set.mem_range, Set.iUnion_exists, Set.iUnion_iUnion_eq',
      Set.mem_diff, Set.mem_iUnion, exists_prop, not_exists, not_and, not_le]
    constructor <;> intro h
    · simp only [h, lt_iff_le_not_le, le_refl, and_imp, imp_self, imp_true_iff, and_self_iff]
    · have h_lt_or_eq : τ a < i ∨ τ a = i := lt_or_eq_of_le h.1
      rcases h_lt_or_eq with (h_lt | rfl)
      · exfalso
        exact h.2 a h_lt (le_refl (τ a))
      · rfl
  rw [this]
  refine' (hτ.measurableSet_le i).diff _
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝ : PartialOrder ι
τ : Ω → ι
f : Filtration ι m
hτ : IsStoppingTime f τ
h_countable : Set.Countable (Set.range τ)
i : ι
this : {ω | τ ω = i} = {ω | τ ω ≤ i} \ ⋃ j ∈ Set.range τ, ⋃ (_ : j < i), {ω | τ ω ≤ j}
⊢ MeasurableSet (⋃ j ∈ Set.range τ, ⋃ (_ : j < i), {ω | τ ω ≤ j})

Next tactic:
refine' MeasurableSet.biUnion h_countable fun j _ => _
protected theorem measurableSet_eq_of_countable_range (hτ : IsStoppingTime f τ)
    (h_countable : (Set.range τ).Countable) (i : ι) : MeasurableSet[f i] {ω | τ ω = i} := by
  have : {ω | τ ω = i} = {ω | τ ω ≤ i} \ ⋃ (j ∈ Set.range τ) (_ : j < i), {ω | τ ω ≤ j} := by
    ext1 a
    simp only [Set.mem_setOf_eq, Set.mem_range, Set.iUnion_exists, Set.iUnion_iUnion_eq',
      Set.mem_diff, Set.mem_iUnion, exists_prop, not_exists, not_and, not_le]
    constructor <;> intro h
    · simp only [h, lt_iff_le_not_le, le_refl, and_imp, imp_self, imp_true_iff, and_self_iff]
    · have h_lt_or_eq : τ a < i ∨ τ a = i := lt_or_eq_of_le h.1
      rcases h_lt_or_eq with (h_lt | rfl)
      · exfalso
        exact h.2 a h_lt (le_refl (τ a))
      · rfl
  rw [this]
  refine' (hτ.measurableSet_le i).diff _
  refine' MeasurableSet.biUnion h_countable fun j _ => _
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝ : PartialOrder ι
τ : Ω → ι
f : Filtration ι m
hτ : IsStoppingTime f τ
h_countable : Set.Countable (Set.range τ)
i : ι
this : {ω | τ ω = i} = {ω | τ ω ≤ i} \ ⋃ j ∈ Set.range τ, ⋃ (_ : j < i), {ω | τ ω ≤ j}
j : ι
x✝ : j ∈ Set.range τ
⊢ MeasurableSet (⋃ (_ : j < i), {ω | τ ω ≤ j})

Next tactic:
by_cases hji : j < i
protected theorem measurableSet_eq_of_countable_range (hτ : IsStoppingTime f τ)
    (h_countable : (Set.range τ).Countable) (i : ι) : MeasurableSet[f i] {ω | τ ω = i} := by
  have : {ω | τ ω = i} = {ω | τ ω ≤ i} \ ⋃ (j ∈ Set.range τ) (_ : j < i), {ω | τ ω ≤ j} := by
    ext1 a
    simp only [Set.mem_setOf_eq, Set.mem_range, Set.iUnion_exists, Set.iUnion_iUnion_eq',
      Set.mem_diff, Set.mem_iUnion, exists_prop, not_exists, not_and, not_le]
    constructor <;> intro h
    · simp only [h, lt_iff_le_not_le, le_refl, and_imp, imp_self, imp_true_iff, and_self_iff]
    · have h_lt_or_eq : τ a < i ∨ τ a = i := lt_or_eq_of_le h.1
      rcases h_lt_or_eq with (h_lt | rfl)
      · exfalso
        exact h.2 a h_lt (le_refl (τ a))
      · rfl
  rw [this]
  refine' (hτ.measurableSet_le i).diff _
  refine' MeasurableSet.biUnion h_countable fun j _ => _
  by_cases hji : j < i
  · 

Proof state:
case pos
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝ : PartialOrder ι
τ : Ω → ι
f : Filtration ι m
hτ : IsStoppingTime f τ
h_countable : Set.Countable (Set.range τ)
i : ι
this : {ω | τ ω = i} = {ω | τ ω ≤ i} \ ⋃ j ∈ Set.range τ, ⋃ (_ : j < i), {ω | τ ω ≤ j}
j : ι
x✝ : j ∈ Set.range τ
hji : j < i
⊢ MeasurableSet (⋃ (_ : j < i), {ω | τ ω ≤ j})

Next tactic:
simp only [hji, Set.iUnion_true]
protected theorem measurableSet_eq_of_countable_range (hτ : IsStoppingTime f τ)
    (h_countable : (Set.range τ).Countable) (i : ι) : MeasurableSet[f i] {ω | τ ω = i} := by
  have : {ω | τ ω = i} = {ω | τ ω ≤ i} \ ⋃ (j ∈ Set.range τ) (_ : j < i), {ω | τ ω ≤ j} := by
    ext1 a
    simp only [Set.mem_setOf_eq, Set.mem_range, Set.iUnion_exists, Set.iUnion_iUnion_eq',
      Set.mem_diff, Set.mem_iUnion, exists_prop, not_exists, not_and, not_le]
    constructor <;> intro h
    · simp only [h, lt_iff_le_not_le, le_refl, and_imp, imp_self, imp_true_iff, and_self_iff]
    · have h_lt_or_eq : τ a < i ∨ τ a = i := lt_or_eq_of_le h.1
      rcases h_lt_or_eq with (h_lt | rfl)
      · exfalso
        exact h.2 a h_lt (le_refl (τ a))
      · rfl
  rw [this]
  refine' (hτ.measurableSet_le i).diff _
  refine' MeasurableSet.biUnion h_countable fun j _ => _
  by_cases hji : j < i
  · simp only [hji, Set.iUnion_true]
    

Proof state:
case pos
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝ : PartialOrder ι
τ : Ω → ι
f : Filtration ι m
hτ : IsStoppingTime f τ
h_countable : Set.Countable (Set.range τ)
i : ι
this : {ω | τ ω = i} = {ω | τ ω ≤ i} \ ⋃ j ∈ Set.range τ, ⋃ (_ : j < i), {ω | τ ω ≤ j}
j : ι
x✝ : j ∈ Set.range τ
hji : j < i
⊢ MeasurableSet {ω | τ ω ≤ j}

Next tactic:
exact f.mono hji.le _ (hτ.measurableSet_le j)
protected theorem measurableSet_eq_of_countable_range (hτ : IsStoppingTime f τ)
    (h_countable : (Set.range τ).Countable) (i : ι) : MeasurableSet[f i] {ω | τ ω = i} := by
  have : {ω | τ ω = i} = {ω | τ ω ≤ i} \ ⋃ (j ∈ Set.range τ) (_ : j < i), {ω | τ ω ≤ j} := by
    ext1 a
    simp only [Set.mem_setOf_eq, Set.mem_range, Set.iUnion_exists, Set.iUnion_iUnion_eq',
      Set.mem_diff, Set.mem_iUnion, exists_prop, not_exists, not_and, not_le]
    constructor <;> intro h
    · simp only [h, lt_iff_le_not_le, le_refl, and_imp, imp_self, imp_true_iff, and_self_iff]
    · have h_lt_or_eq : τ a < i ∨ τ a = i := lt_or_eq_of_le h.1
      rcases h_lt_or_eq with (h_lt | rfl)
      · exfalso
        exact h.2 a h_lt (le_refl (τ a))
      · rfl
  rw [this]
  refine' (hτ.measurableSet_le i).diff _
  refine' MeasurableSet.biUnion h_countable fun j _ => _
  by_cases hji : j < i
  · simp only [hji, Set.iUnion_true]
    exact f.mono hji.le _ (hτ.measurableSet_le j)
  · 

Proof state:
case neg
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝ : PartialOrder ι
τ : Ω → ι
f : Filtration ι m
hτ : IsStoppingTime f τ
h_countable : Set.Countable (Set.range τ)
i : ι
this : {ω | τ ω = i} = {ω | τ ω ≤ i} \ ⋃ j ∈ Set.range τ, ⋃ (_ : j < i), {ω | τ ω ≤ j}
j : ι
x✝ : j ∈ Set.range τ
hji : ¬j < i
⊢ MeasurableSet (⋃ (_ : j < i), {ω | τ ω ≤ j})

Next tactic:
simp only [hji, Set.iUnion_false]
protected theorem measurableSet_eq_of_countable_range (hτ : IsStoppingTime f τ)
    (h_countable : (Set.range τ).Countable) (i : ι) : MeasurableSet[f i] {ω | τ ω = i} := by
  have : {ω | τ ω = i} = {ω | τ ω ≤ i} \ ⋃ (j ∈ Set.range τ) (_ : j < i), {ω | τ ω ≤ j} := by
    ext1 a
    simp only [Set.mem_setOf_eq, Set.mem_range, Set.iUnion_exists, Set.iUnion_iUnion_eq',
      Set.mem_diff, Set.mem_iUnion, exists_prop, not_exists, not_and, not_le]
    constructor <;> intro h
    · simp only [h, lt_iff_le_not_le, le_refl, and_imp, imp_self, imp_true_iff, and_self_iff]
    · have h_lt_or_eq : τ a < i ∨ τ a = i := lt_or_eq_of_le h.1
      rcases h_lt_or_eq with (h_lt | rfl)
      · exfalso
        exact h.2 a h_lt (le_refl (τ a))
      · rfl
  rw [this]
  refine' (hτ.measurableSet_le i).diff _
  refine' MeasurableSet.biUnion h_countable fun j _ => _
  by_cases hji : j < i
  · simp only [hji, Set.iUnion_true]
    exact f.mono hji.le _ (hτ.measurableSet_le j)
  · simp only [hji, Set.iUnion_false]
    

Proof state:
case neg
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝ : PartialOrder ι
τ : Ω → ι
f : Filtration ι m
hτ : IsStoppingTime f τ
h_countable : Set.Countable (Set.range τ)
i : ι
this : {ω | τ ω = i} = {ω | τ ω ≤ i} \ ⋃ j ∈ Set.range τ, ⋃ (_ : j < i), {ω | τ ω ≤ j}
j : ι
x✝ : j ∈ Set.range τ
hji : ¬j < i
⊢ MeasurableSet ∅

Next tactic:
exact @MeasurableSet.empty _ (f i)