l3lab/ntp-mathlib huggingface dataset:
theorem crossing_eq_crossing_of_lowerCrossingTime_lt {M : ℕ} (hNM : N ≤ M)
    (h : lowerCrossingTime a b f N n ω < N) :
    upperCrossingTime a b f M n ω = upperCrossingTime a b f N n ω ∧
      lowerCrossingTime a b f M n ω = lowerCrossingTime a b f N n ω := by
  have h' : upperCrossingTime a b f N n ω < N :=
    lt_of_le_of_lt upperCrossingTime_le_lowerCrossingTime h
  induction' n with k ih
  · simp only [Nat.zero_eq, upperCrossingTime_zero, bot_eq_zero', eq_self_iff_true,
      lowerCrossingTime_zero, true_and_iff, eq_comm]
    refine' hitting_eq_hitting_of_exists hNM _
    rw [lowerCrossingTime, hitting_lt_iff] at h
    obtain ⟨j, hj₁, hj₂⟩ := h
    exacts [⟨j, ⟨hj₁.1, hj₁.2.le⟩, hj₂⟩, le_rfl]
  · specialize ih (lt_of_le_of_lt (lowerCrossingTime_mono (Nat.le_succ _)) h)
      (lt_of_le_of_lt (upperCrossingTime_mono (Nat.le_succ _)) h')
    have : upperCrossingTime a b f M k.succ ω = upperCrossingTime a b f N k.succ ω := by
      rw [upperCrossingTime_succ_eq, hitting_lt_iff] at h'
      simp only [upperCrossingTime_succ_eq]
      obtain ⟨j, hj₁, hj₂⟩ := h'
      rw [eq_comm, ih.2]
      exacts [hitting_eq_hitting_of_exists hNM ⟨j, ⟨hj₁.1, hj₁.2.le⟩, hj₂⟩, le_rfl]
    

Proof state:
case succ
Ω : Type u_1
ι : Type u_2
m0 : MeasurableSpace Ω
μ : Measure Ω
a b : ℝ
f : ℕ → Ω → ℝ
N n m : ℕ
ω : Ω
ℱ : Filtration ℕ m0
M : ℕ
hNM : N ≤ M
k : ℕ
h : lowerCrossingTime a b f N (Nat.succ k) ω < N
h' : upperCrossingTime a b f N (Nat.succ k) ω < N
ih :
  upperCrossingTime a b f M k ω = upperCrossingTime a b f N k ω ∧
    lowerCrossingTime a b f M k ω = lowerCrossingTime a b f N k ω
this : upperCrossingTime a b f M (Nat.succ k) ω = upperCrossingTime a b f N (Nat.succ k) ω
⊢ upperCrossingTime a b f M (Nat.succ k) ω = upperCrossingTime a b f N (Nat.succ k) ω ∧
    lowerCrossingTime a b f M (Nat.succ k) ω = lowerCrossingTime a b f N (Nat.succ k) ω

Next tactic:
refine' ⟨this, _⟩
theorem crossing_eq_crossing_of_lowerCrossingTime_lt {M : ℕ} (hNM : N ≤ M)
    (h : lowerCrossingTime a b f N n ω < N) :
    upperCrossingTime a b f M n ω = upperCrossingTime a b f N n ω ∧
      lowerCrossingTime a b f M n ω = lowerCrossingTime a b f N n ω := by
  have h' : upperCrossingTime a b f N n ω < N :=
    lt_of_le_of_lt upperCrossingTime_le_lowerCrossingTime h
  induction' n with k ih
  · simp only [Nat.zero_eq, upperCrossingTime_zero, bot_eq_zero', eq_self_iff_true,
      lowerCrossingTime_zero, true_and_iff, eq_comm]
    refine' hitting_eq_hitting_of_exists hNM _
    rw [lowerCrossingTime, hitting_lt_iff] at h
    obtain ⟨j, hj₁, hj₂⟩ := h
    exacts [⟨j, ⟨hj₁.1, hj₁.2.le⟩, hj₂⟩, le_rfl]
  · specialize ih (lt_of_le_of_lt (lowerCrossingTime_mono (Nat.le_succ _)) h)
      (lt_of_le_of_lt (upperCrossingTime_mono (Nat.le_succ _)) h')
    have : upperCrossingTime a b f M k.succ ω = upperCrossingTime a b f N k.succ ω := by
      rw [upperCrossingTime_succ_eq, hitting_lt_iff] at h'
      simp only [upperCrossingTime_succ_eq]
      obtain ⟨j, hj₁, hj₂⟩ := h'
      rw [eq_comm, ih.2]
      exacts [hitting_eq_hitting_of_exists hNM ⟨j, ⟨hj₁.1, hj₁.2.le⟩, hj₂⟩, le_rfl]
    refine' ⟨this, _⟩
    

Proof state:
case succ
Ω : Type u_1
ι : Type u_2
m0 : MeasurableSpace Ω
μ : Measure Ω
a b : ℝ
f : ℕ → Ω → ℝ
N n m : ℕ
ω : Ω
ℱ : Filtration ℕ m0
M : ℕ
hNM : N ≤ M
k : ℕ
h : lowerCrossingTime a b f N (Nat.succ k) ω < N
h' : upperCrossingTime a b f N (Nat.succ k) ω < N
ih :
  upperCrossingTime a b f M k ω = upperCrossingTime a b f N k ω ∧
    lowerCrossingTime a b f M k ω = lowerCrossingTime a b f N k ω
this : upperCrossingTime a b f M (Nat.succ k) ω = upperCrossingTime a b f N (Nat.succ k) ω
⊢ lowerCrossingTime a b f M (Nat.succ k) ω = lowerCrossingTime a b f N (Nat.succ k) ω

Next tactic:
simp only [lowerCrossingTime, eq_comm, this]
theorem crossing_eq_crossing_of_lowerCrossingTime_lt {M : ℕ} (hNM : N ≤ M)
    (h : lowerCrossingTime a b f N n ω < N) :
    upperCrossingTime a b f M n ω = upperCrossingTime a b f N n ω ∧
      lowerCrossingTime a b f M n ω = lowerCrossingTime a b f N n ω := by
  have h' : upperCrossingTime a b f N n ω < N :=
    lt_of_le_of_lt upperCrossingTime_le_lowerCrossingTime h
  induction' n with k ih
  · simp only [Nat.zero_eq, upperCrossingTime_zero, bot_eq_zero', eq_self_iff_true,
      lowerCrossingTime_zero, true_and_iff, eq_comm]
    refine' hitting_eq_hitting_of_exists hNM _
    rw [lowerCrossingTime, hitting_lt_iff] at h
    obtain ⟨j, hj₁, hj₂⟩ := h
    exacts [⟨j, ⟨hj₁.1, hj₁.2.le⟩, hj₂⟩, le_rfl]
  · specialize ih (lt_of_le_of_lt (lowerCrossingTime_mono (Nat.le_succ _)) h)
      (lt_of_le_of_lt (upperCrossingTime_mono (Nat.le_succ _)) h')
    have : upperCrossingTime a b f M k.succ ω = upperCrossingTime a b f N k.succ ω := by
      rw [upperCrossingTime_succ_eq, hitting_lt_iff] at h'
      simp only [upperCrossingTime_succ_eq]
      obtain ⟨j, hj₁, hj₂⟩ := h'
      rw [eq_comm, ih.2]
      exacts [hitting_eq_hitting_of_exists hNM ⟨j, ⟨hj₁.1, hj₁.2.le⟩, hj₂⟩, le_rfl]
    refine' ⟨this, _⟩
    simp only [lowerCrossingTime, eq_comm, this]
    

Proof state:
case succ
Ω : Type u_1
ι : Type u_2
m0 : MeasurableSpace Ω
μ : Measure Ω
a b : ℝ
f : ℕ → Ω → ℝ
N n m : ℕ
ω : Ω
ℱ : Filtration ℕ m0
M : ℕ
hNM : N ≤ M
k : ℕ
h : lowerCrossingTime a b f N (Nat.succ k) ω < N
h' : upperCrossingTime a b f N (Nat.succ k) ω < N
ih :
  upperCrossingTime a b f M k ω = upperCrossingTime a b f N k ω ∧
    lowerCrossingTime a b f M k ω = lowerCrossingTime a b f N k ω
this : upperCrossingTime a b f M (Nat.succ k) ω = upperCrossingTime a b f N (Nat.succ k) ω
⊢ hitting f (Set.Iic a) (upperCrossingTime a b f N (Nat.succ k) ω) N ω =
    hitting f (Set.Iic a) (upperCrossingTime a b f N (Nat.succ k) ω) M ω

Next tactic:
refine' hitting_eq_hitting_of_exists hNM _
theorem crossing_eq_crossing_of_lowerCrossingTime_lt {M : ℕ} (hNM : N ≤ M)
    (h : lowerCrossingTime a b f N n ω < N) :
    upperCrossingTime a b f M n ω = upperCrossingTime a b f N n ω ∧
      lowerCrossingTime a b f M n ω = lowerCrossingTime a b f N n ω := by
  have h' : upperCrossingTime a b f N n ω < N :=
    lt_of_le_of_lt upperCrossingTime_le_lowerCrossingTime h
  induction' n with k ih
  · simp only [Nat.zero_eq, upperCrossingTime_zero, bot_eq_zero', eq_self_iff_true,
      lowerCrossingTime_zero, true_and_iff, eq_comm]
    refine' hitting_eq_hitting_of_exists hNM _
    rw [lowerCrossingTime, hitting_lt_iff] at h
    obtain ⟨j, hj₁, hj₂⟩ := h
    exacts [⟨j, ⟨hj₁.1, hj₁.2.le⟩, hj₂⟩, le_rfl]
  · specialize ih (lt_of_le_of_lt (lowerCrossingTime_mono (Nat.le_succ _)) h)
      (lt_of_le_of_lt (upperCrossingTime_mono (Nat.le_succ _)) h')
    have : upperCrossingTime a b f M k.succ ω = upperCrossingTime a b f N k.succ ω := by
      rw [upperCrossingTime_succ_eq, hitting_lt_iff] at h'
      simp only [upperCrossingTime_succ_eq]
      obtain ⟨j, hj₁, hj₂⟩ := h'
      rw [eq_comm, ih.2]
      exacts [hitting_eq_hitting_of_exists hNM ⟨j, ⟨hj₁.1, hj₁.2.le⟩, hj₂⟩, le_rfl]
    refine' ⟨this, _⟩
    simp only [lowerCrossingTime, eq_comm, this]
    refine' hitting_eq_hitting_of_exists hNM _
    

Proof state:
case succ
Ω : Type u_1
ι : Type u_2
m0 : MeasurableSpace Ω
μ : Measure Ω
a b : ℝ
f : ℕ → Ω → ℝ
N n m : ℕ
ω : Ω
ℱ : Filtration ℕ m0
M : ℕ
hNM : N ≤ M
k : ℕ
h : lowerCrossingTime a b f N (Nat.succ k) ω < N
h' : upperCrossingTime a b f N (Nat.succ k) ω < N
ih :
  upperCrossingTime a b f M k ω = upperCrossingTime a b f N k ω ∧
    lowerCrossingTime a b f M k ω = lowerCrossingTime a b f N k ω
this : upperCrossingTime a b f M (Nat.succ k) ω = upperCrossingTime a b f N (Nat.succ k) ω
⊢ ∃ j ∈ Set.Icc (upperCrossingTime a b f N (Nat.succ k) ω) N, f j ω ∈ Set.Iic a

Next tactic:
rw [lowerCrossingTime, hitting_lt_iff _ le_rfl] at h
theorem crossing_eq_crossing_of_lowerCrossingTime_lt {M : ℕ} (hNM : N ≤ M)
    (h : lowerCrossingTime a b f N n ω < N) :
    upperCrossingTime a b f M n ω = upperCrossingTime a b f N n ω ∧
      lowerCrossingTime a b f M n ω = lowerCrossingTime a b f N n ω := by
  have h' : upperCrossingTime a b f N n ω < N :=
    lt_of_le_of_lt upperCrossingTime_le_lowerCrossingTime h
  induction' n with k ih
  · simp only [Nat.zero_eq, upperCrossingTime_zero, bot_eq_zero', eq_self_iff_true,
      lowerCrossingTime_zero, true_and_iff, eq_comm]
    refine' hitting_eq_hitting_of_exists hNM _
    rw [lowerCrossingTime, hitting_lt_iff] at h
    obtain ⟨j, hj₁, hj₂⟩ := h
    exacts [⟨j, ⟨hj₁.1, hj₁.2.le⟩, hj₂⟩, le_rfl]
  · specialize ih (lt_of_le_of_lt (lowerCrossingTime_mono (Nat.le_succ _)) h)
      (lt_of_le_of_lt (upperCrossingTime_mono (Nat.le_succ _)) h')
    have : upperCrossingTime a b f M k.succ ω = upperCrossingTime a b f N k.succ ω := by
      rw [upperCrossingTime_succ_eq, hitting_lt_iff] at h'
      simp only [upperCrossingTime_succ_eq]
      obtain ⟨j, hj₁, hj₂⟩ := h'
      rw [eq_comm, ih.2]
      exacts [hitting_eq_hitting_of_exists hNM ⟨j, ⟨hj₁.1, hj₁.2.le⟩, hj₂⟩, le_rfl]
    refine' ⟨this, _⟩
    simp only [lowerCrossingTime, eq_comm, this]
    refine' hitting_eq_hitting_of_exists hNM _
    rw [lowerCrossingTime, hitting_lt_iff _ le_rfl] at h
    

Proof state:
case succ
Ω : Type u_1
ι : Type u_2
m0 : MeasurableSpace Ω
μ : Measure Ω
a b : ℝ
f : ℕ → Ω → ℝ
N n m : ℕ
ω : Ω
ℱ : Filtration ℕ m0
M : ℕ
hNM : N ≤ M
k : ℕ
h : ∃ j ∈ Set.Ico (upperCrossingTime a b f N (Nat.succ k) ω) N, f j ω ∈ Set.Iic a
h' : upperCrossingTime a b f N (Nat.succ k) ω < N
ih :
  upperCrossingTime a b f M k ω = upperCrossingTime a b f N k ω ∧
    lowerCrossingTime a b f M k ω = lowerCrossingTime a b f N k ω
this : upperCrossingTime a b f M (Nat.succ k) ω = upperCrossingTime a b f N (Nat.succ k) ω
⊢ ∃ j ∈ Set.Icc (upperCrossingTime a b f N (Nat.succ k) ω) N, f j ω ∈ Set.Iic a

Next tactic:
obtain ⟨j, hj₁, hj₂⟩ := h
theorem crossing_eq_crossing_of_lowerCrossingTime_lt {M : ℕ} (hNM : N ≤ M)
    (h : lowerCrossingTime a b f N n ω < N) :
    upperCrossingTime a b f M n ω = upperCrossingTime a b f N n ω ∧
      lowerCrossingTime a b f M n ω = lowerCrossingTime a b f N n ω := by
  have h' : upperCrossingTime a b f N n ω < N :=
    lt_of_le_of_lt upperCrossingTime_le_lowerCrossingTime h
  induction' n with k ih
  · simp only [Nat.zero_eq, upperCrossingTime_zero, bot_eq_zero', eq_self_iff_true,
      lowerCrossingTime_zero, true_and_iff, eq_comm]
    refine' hitting_eq_hitting_of_exists hNM _
    rw [lowerCrossingTime, hitting_lt_iff] at h
    obtain ⟨j, hj₁, hj₂⟩ := h
    exacts [⟨j, ⟨hj₁.1, hj₁.2.le⟩, hj₂⟩, le_rfl]
  · specialize ih (lt_of_le_of_lt (lowerCrossingTime_mono (Nat.le_succ _)) h)
      (lt_of_le_of_lt (upperCrossingTime_mono (Nat.le_succ _)) h')
    have : upperCrossingTime a b f M k.succ ω = upperCrossingTime a b f N k.succ ω := by
      rw [upperCrossingTime_succ_eq, hitting_lt_iff] at h'
      simp only [upperCrossingTime_succ_eq]
      obtain ⟨j, hj₁, hj₂⟩ := h'
      rw [eq_comm, ih.2]
      exacts [hitting_eq_hitting_of_exists hNM ⟨j, ⟨hj₁.1, hj₁.2.le⟩, hj₂⟩, le_rfl]
    refine' ⟨this, _⟩
    simp only [lowerCrossingTime, eq_comm, this]
    refine' hitting_eq_hitting_of_exists hNM _
    rw [lowerCrossingTime, hitting_lt_iff _ le_rfl] at h
    obtain ⟨j, hj₁, hj₂⟩ := h
    

Proof state:
case succ.intro.intro
Ω : Type u_1
ι : Type u_2
m0 : MeasurableSpace Ω
μ : Measure Ω
a b : ℝ
f : ℕ → Ω → ℝ
N n m : ℕ
ω : Ω
ℱ : Filtration ℕ m0
M : ℕ
hNM : N ≤ M
k : ℕ
h' : upperCrossingTime a b f N (Nat.succ k) ω < N
ih :
  upperCrossingTime a b f M k ω = upperCrossingTime a b f N k ω ∧
    lowerCrossingTime a b f M k ω = lowerCrossingTime a b f N k ω
this : upperCrossingTime a b f M (Nat.succ k) ω = upperCrossingTime a b f N (Nat.succ k) ω
j : ℕ
hj₁ : j ∈ Set.Ico (upperCrossingTime a b f N (Nat.succ k) ω) N
hj₂ : f j ω ∈ Set.Iic a
⊢ ∃ j ∈ Set.Icc (upperCrossingTime a b f N (Nat.succ k) ω) N, f j ω ∈ Set.Iic a

Next tactic:
exact ⟨j, ⟨hj₁.1, hj₁.2.le⟩, hj₂⟩
theorem crossing_eq_crossing_of_upperCrossingTime_lt {M : ℕ} (hNM : N ≤ M)
    (h : upperCrossingTime a b f N (n + 1) ω < N) :
    upperCrossingTime a b f M (n + 1) ω = upperCrossingTime a b f N (n + 1) ω ∧
      lowerCrossingTime a b f M n ω = lowerCrossingTime a b f N n ω := by
  

Proof state:
Ω : Type u_1
ι : Type u_2
m0 : MeasurableSpace Ω
μ : Measure Ω
a b : ℝ
f : ℕ → Ω → ℝ
N n m : ℕ
ω : Ω
ℱ : Filtration ℕ m0
M : ℕ
hNM : N ≤ M
h : upperCrossingTime a b f N (n + 1) ω < N
⊢ upperCrossingTime a b f M (n + 1) ω = upperCrossingTime a b f N (n + 1) ω ∧
    lowerCrossingTime a b f M n ω = lowerCrossingTime a b f N n ω

Next tactic:
have := (crossing_eq_crossing_of_lowerCrossingTime_lt hNM
    (lt_of_le_of_lt lowerCrossingTime_le_upperCrossingTime_succ h)).2
theorem crossing_eq_crossing_of_upperCrossingTime_lt {M : ℕ} (hNM : N ≤ M)
    (h : upperCrossingTime a b f N (n + 1) ω < N) :
    upperCrossingTime a b f M (n + 1) ω = upperCrossingTime a b f N (n + 1) ω ∧
      lowerCrossingTime a b f M n ω = lowerCrossingTime a b f N n ω := by
  have := (crossing_eq_crossing_of_lowerCrossingTime_lt hNM
    (lt_of_le_of_lt lowerCrossingTime_le_upperCrossingTime_succ h)).2
  

Proof state:
Ω : Type u_1
ι : Type u_2
m0 : MeasurableSpace Ω
μ : Measure Ω
a b : ℝ
f : ℕ → Ω → ℝ
N n m : ℕ
ω : Ω
ℱ : Filtration ℕ m0
M : ℕ
hNM : N ≤ M
h : upperCrossingTime a b f N (n + 1) ω < N
this : lowerCrossingTime a b f M n ω = lowerCrossingTime a b f N n ω
⊢ upperCrossingTime a b f M (n + 1) ω = upperCrossingTime a b f N (n + 1) ω ∧
    lowerCrossingTime a b f M n ω = lowerCrossingTime a b f N n ω

Next tactic:
refine' ⟨_, this⟩
theorem crossing_eq_crossing_of_upperCrossingTime_lt {M : ℕ} (hNM : N ≤ M)
    (h : upperCrossingTime a b f N (n + 1) ω < N) :
    upperCrossingTime a b f M (n + 1) ω = upperCrossingTime a b f N (n + 1) ω ∧
      lowerCrossingTime a b f M n ω = lowerCrossingTime a b f N n ω := by
  have := (crossing_eq_crossing_of_lowerCrossingTime_lt hNM
    (lt_of_le_of_lt lowerCrossingTime_le_upperCrossingTime_succ h)).2
  refine' ⟨_, this⟩
  

Proof state:
Ω : Type u_1
ι : Type u_2
m0 : MeasurableSpace Ω
μ : Measure Ω
a b : ℝ
f : ℕ → Ω → ℝ
N n m : ℕ
ω : Ω
ℱ : Filtration ℕ m0
M : ℕ
hNM : N ≤ M
h : upperCrossingTime a b f N (n + 1) ω < N
this : lowerCrossingTime a b f M n ω = lowerCrossingTime a b f N n ω
⊢ upperCrossingTime a b f M (n + 1) ω = upperCrossingTime a b f N (n + 1) ω

Next tactic:
rw [upperCrossingTime_succ_eq, upperCrossingTime_succ_eq, eq_comm, this]
theorem crossing_eq_crossing_of_upperCrossingTime_lt {M : ℕ} (hNM : N ≤ M)
    (h : upperCrossingTime a b f N (n + 1) ω < N) :
    upperCrossingTime a b f M (n + 1) ω = upperCrossingTime a b f N (n + 1) ω ∧
      lowerCrossingTime a b f M n ω = lowerCrossingTime a b f N n ω := by
  have := (crossing_eq_crossing_of_lowerCrossingTime_lt hNM
    (lt_of_le_of_lt lowerCrossingTime_le_upperCrossingTime_succ h)).2
  refine' ⟨_, this⟩
  rw [upperCrossingTime_succ_eq, upperCrossingTime_succ_eq, eq_comm, this]
  

Proof state:
Ω : Type u_1
ι : Type u_2
m0 : MeasurableSpace Ω
μ : Measure Ω
a b : ℝ
f : ℕ → Ω → ℝ
N n m : ℕ
ω : Ω
ℱ : Filtration ℕ m0
M : ℕ
hNM : N ≤ M
h : upperCrossingTime a b f N (n + 1) ω < N
this : lowerCrossingTime a b f M n ω = lowerCrossingTime a b f N n ω
⊢ hitting f (Set.Ici b) (lowerCrossingTime a b f N n ω) N ω = hitting f (Set.Ici b) (lowerCrossingTime a b f N n ω) M ω

Next tactic:
refine' hitting_eq_hitting_of_exists hNM _
theorem crossing_eq_crossing_of_upperCrossingTime_lt {M : ℕ} (hNM : N ≤ M)
    (h : upperCrossingTime a b f N (n + 1) ω < N) :
    upperCrossingTime a b f M (n + 1) ω = upperCrossingTime a b f N (n + 1) ω ∧
      lowerCrossingTime a b f M n ω = lowerCrossingTime a b f N n ω := by
  have := (crossing_eq_crossing_of_lowerCrossingTime_lt hNM
    (lt_of_le_of_lt lowerCrossingTime_le_upperCrossingTime_succ h)).2
  refine' ⟨_, this⟩
  rw [upperCrossingTime_succ_eq, upperCrossingTime_succ_eq, eq_comm, this]
  refine' hitting_eq_hitting_of_exists hNM _
  

Proof state:
Ω : Type u_1
ι : Type u_2
m0 : MeasurableSpace Ω
μ : Measure Ω
a b : ℝ
f : ℕ → Ω → ℝ
N n m : ℕ
ω : Ω
ℱ : Filtration ℕ m0
M : ℕ
hNM : N ≤ M
h : upperCrossingTime a b f N (n + 1) ω < N
this : lowerCrossingTime a b f M n ω = lowerCrossingTime a b f N n ω
⊢ ∃ j ∈ Set.Icc (lowerCrossingTime a b f N n ω) N, f j ω ∈ Set.Ici b

Next tactic:
rw [upperCrossingTime_succ_eq, hitting_lt_iff] at h
theorem crossing_eq_crossing_of_upperCrossingTime_lt {M : ℕ} (hNM : N ≤ M)
    (h : upperCrossingTime a b f N (n + 1) ω < N) :
    upperCrossingTime a b f M (n + 1) ω = upperCrossingTime a b f N (n + 1) ω ∧
      lowerCrossingTime a b f M n ω = lowerCrossingTime a b f N n ω := by
  have := (crossing_eq_crossing_of_lowerCrossingTime_lt hNM
    (lt_of_le_of_lt lowerCrossingTime_le_upperCrossingTime_succ h)).2
  refine' ⟨_, this⟩
  rw [upperCrossingTime_succ_eq, upperCrossingTime_succ_eq, eq_comm, this]
  refine' hitting_eq_hitting_of_exists hNM _
  rw [upperCrossingTime_succ_eq, hitting_lt_iff] at h
  

Proof state:
Ω : Type u_1
ι : Type u_2
m0 : MeasurableSpace Ω
μ : Measure Ω
a b : ℝ
f : ℕ → Ω → ℝ
N n m : ℕ
ω : Ω
ℱ : Filtration ℕ m0
M : ℕ
hNM : N ≤ M
h : ∃ j ∈ Set.Ico (lowerCrossingTime a b f N n ω) N, f j ω ∈ Set.Ici b
this : lowerCrossingTime a b f M n ω = lowerCrossingTime a b f N n ω
⊢ ∃ j ∈ Set.Icc (lowerCrossingTime a b f N n ω) N, f j ω ∈ Set.Ici b
case hi
Ω : Type u_1
ι : Type u_2
m0 : MeasurableSpace Ω
μ : Measure Ω
a b : ℝ
f : ℕ → Ω → ℝ
N n m : ℕ
ω : Ω
ℱ : Filtration ℕ m0
M : ℕ
hNM : N ≤ M
h : hitting f (Set.Ici b) (lowerCrossingTime a b f N n ω) N ω < N
this : lowerCrossingTime a b f M n ω = lowerCrossingTime a b f N n ω
⊢ N ≤ N

Next tactic:
obtain ⟨j, hj₁, hj₂⟩ := h
theorem crossing_eq_crossing_of_upperCrossingTime_lt {M : ℕ} (hNM : N ≤ M)
    (h : upperCrossingTime a b f N (n + 1) ω < N) :
    upperCrossingTime a b f M (n + 1) ω = upperCrossingTime a b f N (n + 1) ω ∧
      lowerCrossingTime a b f M n ω = lowerCrossingTime a b f N n ω := by
  have := (crossing_eq_crossing_of_lowerCrossingTime_lt hNM
    (lt_of_le_of_lt lowerCrossingTime_le_upperCrossingTime_succ h)).2
  refine' ⟨_, this⟩
  rw [upperCrossingTime_succ_eq, upperCrossingTime_succ_eq, eq_comm, this]
  refine' hitting_eq_hitting_of_exists hNM _
  rw [upperCrossingTime_succ_eq, hitting_lt_iff] at h
  obtain ⟨j, hj₁, hj₂⟩ := h
  

Proof state:
case intro.intro
Ω : Type u_1
ι : Type u_2
m0 : MeasurableSpace Ω
μ : Measure Ω
a b : ℝ
f : ℕ → Ω → ℝ
N n m : ℕ
ω : Ω
ℱ : Filtration ℕ m0
M : ℕ
hNM : N ≤ M
this : lowerCrossingTime a b f M n ω = lowerCrossingTime a b f N n ω
j : ℕ
hj₁ : j ∈ Set.Ico (lowerCrossingTime a b f N n ω) N
hj₂ : f j ω ∈ Set.Ici b
⊢ ∃ j ∈ Set.Icc (lowerCrossingTime a b f N n ω) N, f j ω ∈ Set.Ici b
case hi
Ω : Type u_1
ι : Type u_2
m0 : MeasurableSpace Ω
μ : Measure Ω
a b : ℝ
f : ℕ → Ω → ℝ
N n m : ℕ
ω : Ω
ℱ : Filtration ℕ m0
M : ℕ
hNM : N ≤ M
h : hitting f (Set.Ici b) (lowerCrossingTime a b f N n ω) N ω < N
this : lowerCrossingTime a b f M n ω = lowerCrossingTime a b f N n ω
⊢ N ≤ N

Next tactic:
exacts [⟨j, ⟨hj₁.1, hj₁.2.le⟩, hj₂⟩, le_rfl]
theorem upperCrossingTime_eq_upperCrossingTime_of_lt {M : ℕ} (hNM : N ≤ M)
    (h : upperCrossingTime a b f N n ω < N) :
    upperCrossingTime a b f M n ω = upperCrossingTime a b f N n ω := by
  

Proof state:
Ω : Type u_1
ι : Type u_2
m0 : MeasurableSpace Ω
μ : Measure Ω
a b : ℝ
f : ℕ → Ω → ℝ
N n m : ℕ
ω : Ω
ℱ : Filtration ℕ m0
M : ℕ
hNM : N ≤ M
h : upperCrossingTime a b f N n ω < N
⊢ upperCrossingTime a b f M n ω = upperCrossingTime a b f N n ω

Next tactic:
cases n
theorem upperCrossingTime_eq_upperCrossingTime_of_lt {M : ℕ} (hNM : N ≤ M)
    (h : upperCrossingTime a b f N n ω < N) :
    upperCrossingTime a b f M n ω = upperCrossingTime a b f N n ω := by
  cases n
  · 

Proof state:
case zero
Ω : Type u_1
ι : Type u_2
m0 : MeasurableSpace Ω
μ : Measure Ω
a b : ℝ
f : ℕ → Ω → ℝ
N m : ℕ
ω : Ω
ℱ : Filtration ℕ m0
M : ℕ
hNM : N ≤ M
h : upperCrossingTime a b f N Nat.zero ω < N
⊢ upperCrossingTime a b f M Nat.zero ω = upperCrossingTime a b f N Nat.zero ω

Next tactic:
simp
theorem upperCrossingTime_eq_upperCrossingTime_of_lt {M : ℕ} (hNM : N ≤ M)
    (h : upperCrossingTime a b f N n ω < N) :
    upperCrossingTime a b f M n ω = upperCrossingTime a b f N n ω := by
  cases n
  · simp
  · 

Proof state:
case succ
Ω : Type u_1
ι : Type u_2
m0 : MeasurableSpace Ω
μ : Measure Ω
a b : ℝ
f : ℕ → Ω → ℝ
N m : ℕ
ω : Ω
ℱ : Filtration ℕ m0
M : ℕ
hNM : N ≤ M
n✝ : ℕ
h : upperCrossingTime a b f N (Nat.succ n✝) ω < N
⊢ upperCrossingTime a b f M (Nat.succ n✝) ω = upperCrossingTime a b f N (Nat.succ n✝) ω

Next tactic:
exact (crossing_eq_crossing_of_upperCrossingTime_lt hNM h).1
theorem upcrossingsBefore_mono (hab : a < b) : Monotone fun N ω => upcrossingsBefore a b f N ω := by
  

Proof state:
Ω : Type u_1
ι : Type u_2
m0 : MeasurableSpace Ω
μ : Measure Ω
a b : ℝ
f : ℕ → Ω → ℝ
N n m : ℕ
ω : Ω
ℱ : Filtration ℕ m0
hab : a < b
⊢ Monotone fun N ω => upcrossingsBefore a b f N ω

Next tactic:
intro N M hNM ω
theorem upcrossingsBefore_mono (hab : a < b) : Monotone fun N ω => upcrossingsBefore a b f N ω := by
  intro N M hNM ω
  

Proof state:
Ω : Type u_1
ι : Type u_2
m0 : MeasurableSpace Ω
μ : Measure Ω
a b : ℝ
f : ℕ → Ω → ℝ
N✝ n m : ℕ
ω✝ : Ω
ℱ : Filtration ℕ m0
hab : a < b
N M : ℕ
hNM : N ≤ M
ω : Ω
⊢ (fun N ω => upcrossingsBefore a b f N ω) N ω ≤ (fun N ω => upcrossingsBefore a b f N ω) M ω

Next tactic:
simp only [upcrossingsBefore]
theorem upcrossingsBefore_mono (hab : a < b) : Monotone fun N ω => upcrossingsBefore a b f N ω := by
  intro N M hNM ω
  simp only [upcrossingsBefore]
  

Proof state:
Ω : Type u_1
ι : Type u_2
m0 : MeasurableSpace Ω
μ : Measure Ω
a b : ℝ
f : ℕ → Ω → ℝ
N✝ n m : ℕ
ω✝ : Ω
ℱ : Filtration ℕ m0
hab : a < b
N M : ℕ
hNM : N ≤ M
ω : Ω
⊢ sSup {n | upperCrossingTime a b f N n ω < N} ≤ sSup {n | upperCrossingTime a b f M n ω < M}

Next tactic:
by_cases hemp : {n : ℕ | upperCrossingTime a b f N n ω < N}.Nonempty
theorem upcrossingsBefore_mono (hab : a < b) : Monotone fun N ω => upcrossingsBefore a b f N ω := by
  intro N M hNM ω
  simp only [upcrossingsBefore]
  by_cases hemp : {n : ℕ | upperCrossingTime a b f N n ω < N}.Nonempty
  · 

Proof state:
case pos
Ω : Type u_1
ι : Type u_2
m0 : MeasurableSpace Ω
μ : Measure Ω
a b : ℝ
f : ℕ → Ω → ℝ
N✝ n m : ℕ
ω✝ : Ω
ℱ : Filtration ℕ m0
hab : a < b
N M : ℕ
hNM : N ≤ M
ω : Ω
hemp : Set.Nonempty {n | upperCrossingTime a b f N n ω < N}
⊢ sSup {n | upperCrossingTime a b f N n ω < N} ≤ sSup {n | upperCrossingTime a b f M n ω < M}

Next tactic:
refine' csSup_le_csSup (upperCrossingTime_lt_bddAbove hab) hemp fun n hn => _
theorem upcrossingsBefore_mono (hab : a < b) : Monotone fun N ω => upcrossingsBefore a b f N ω := by
  intro N M hNM ω
  simp only [upcrossingsBefore]
  by_cases hemp : {n : ℕ | upperCrossingTime a b f N n ω < N}.Nonempty
  · refine' csSup_le_csSup (upperCrossingTime_lt_bddAbove hab) hemp fun n hn => _
    

Proof state:
case pos
Ω : Type u_1
ι : Type u_2
m0 : MeasurableSpace Ω
μ : Measure Ω
a b : ℝ
f : ℕ → Ω → ℝ
N✝ n✝ m : ℕ
ω✝ : Ω
ℱ : Filtration ℕ m0
hab : a < b
N M : ℕ
hNM : N ≤ M
ω : Ω
hemp : Set.Nonempty {n | upperCrossingTime a b f N n ω < N}
n : ℕ
hn : n ∈ {n | upperCrossingTime a b f N n ω < N}
⊢ n ∈ {n | upperCrossingTime a b f M n ω < M}

Next tactic:
rw [Set.mem_setOf_eq, upperCrossingTime_eq_upperCrossingTime_of_lt hNM hn]
theorem upcrossingsBefore_mono (hab : a < b) : Monotone fun N ω => upcrossingsBefore a b f N ω := by
  intro N M hNM ω
  simp only [upcrossingsBefore]
  by_cases hemp : {n : ℕ | upperCrossingTime a b f N n ω < N}.Nonempty
  · refine' csSup_le_csSup (upperCrossingTime_lt_bddAbove hab) hemp fun n hn => _
    rw [Set.mem_setOf_eq, upperCrossingTime_eq_upperCrossingTime_of_lt hNM hn]
    

Proof state:
case pos
Ω : Type u_1
ι : Type u_2
m0 : MeasurableSpace Ω
μ : Measure Ω
a b : ℝ
f : ℕ → Ω → ℝ
N✝ n✝ m : ℕ
ω✝ : Ω
ℱ : Filtration ℕ m0
hab : a < b
N M : ℕ
hNM : N ≤ M
ω : Ω
hemp : Set.Nonempty {n | upperCrossingTime a b f N n ω < N}
n : ℕ
hn : n ∈ {n | upperCrossingTime a b f N n ω < N}
⊢ upperCrossingTime a b f N n ω < M

Next tactic:
exact lt_of_lt_of_le hn hNM