l3lab/ntp-mathlib huggingface dataset:
theorem tendsto_preCdf_atBot_zero (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
    ∀ᵐ a ∂ρ.fst, Tendsto (fun r => preCdf ρ r a) atBot (𝓝 0) := by
  -- We show first that `preCdf` has a limit in ℝ≥0∞ almost everywhere.
  -- We then show that the integral of `pre_cdf` tends to 0, and that it also tends
  -- to the integral of the limit. Since the limit has integral 0, it is equal to 0 a.e.
  suffices ∀ᵐ a ∂ρ.fst, Tendsto (fun r => preCdf ρ (-r) a) atTop (𝓝 0) by
    filter_upwards [this] with a ha
    have h_eq_neg : (fun r : ℚ => preCdf ρ r a) = fun r : ℚ => preCdf ρ (- -r) a := by
      simp_rw [neg_neg]
    rw [h_eq_neg]
    exact ha.comp tendsto_neg_atBot_atTop
  have h_exists : ∀ᵐ a ∂ρ.fst, ∃ l, Tendsto (fun r => preCdf ρ (-r) a) atTop (𝓝 l) := by
    filter_upwards [monotone_preCdf ρ] with a ha
    have h_anti : Antitone fun r => preCdf ρ (-r) a := fun p q hpq => ha (neg_le_neg hpq)
    have h_tendsto :
      Tendsto (fun r => preCdf ρ (-r) a) atTop atBot ∨
        ∃ l, Tendsto (fun r => preCdf ρ (-r) a) atTop (𝓝 l) :=
      tendsto_of_antitone h_anti
    cases' h_tendsto with h_bot h_tendsto
    · exact ⟨0, Tendsto.mono_right h_bot atBot_le_nhds_bot⟩
    · exact h_tendsto
  classical
  let F : α → ℝ≥0∞ := fun a =>
    if h : ∃ l, Tendsto (fun r => preCdf ρ (-r) a) atTop (𝓝 l) then h.choose else 0
  have h_tendsto : ∀ᵐ a ∂ρ.fst, Tendsto (fun r => preCdf ρ (-r) a) atTop (𝓝 (F a)) := by
    filter_upwards [h_exists] with a ha
    simp_rw [dif_pos ha]
    exact ha.choose_spec
  suffices h_lintegral_eq : ∫⁻ a, F a ∂ρ.fst = 0
  · have hF_ae_meas : AEMeasurable F ρ.fst := by
      refine' aemeasurable_of_tendsto_metrizable_ae _ (fun n => _) h_tendsto
      exact measurable_preCdf.aemeasurable
    rw [lintegral_eq_zero_iff' hF_ae_meas] at h_lintegral_eq
    filter_upwards [h_tendsto, h_lintegral_eq] with a ha_tendsto ha_eq
    rwa [ha_eq] at ha_tendsto
  have h_lintegral :
    Tendsto (fun r => ∫⁻ a, preCdf ρ (-r) a ∂ρ.fst) atTop (𝓝 (∫⁻ a, F a ∂ρ.fst)) := by
    refine'
      tendsto_lintegral_filter_of_dominated_convergence (fun _ => 1)
        (eventually_of_forall fun _ => measurable_preCdf) (eventually_of_forall fun _ => _) _
        h_tendsto
    · filter_upwards [preCdf_le_one ρ] with a ha using ha _
    · rw [lintegral_one]
      exact measure_ne_top _ _
  have h_lintegral' : Tendsto (fun r => ∫⁻ a, preCdf ρ (-r) a ∂ρ.fst) atTop (𝓝 0) := by
    have h_lintegral_eq :
      (fun r => ∫⁻ a, preCdf ρ (-r) a ∂ρ.fst) = fun r : ℚ => ρ (univ ×ˢ Iic (-r : ℝ)) := by
      

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
inst✝ : IsFiniteMeasure ρ
h_exists : ∀ᵐ (a : α) ∂Measure.fst ρ, ∃ l, Tendsto (fun r => preCdf ρ (-r) a) atTop (𝓝 l)
F : α → ℝ≥0∞ := fun a => if h : ∃ l, Tendsto (fun r => preCdf ρ (-r) a) atTop (𝓝 l) then Exists.choose h else 0
h_tendsto : ∀ᵐ (a : α) ∂Measure.fst ρ, Tendsto (fun r => preCdf ρ (-r) a) atTop (𝓝 (F a))
h_lintegral : Tendsto (fun r => ∫⁻ (a : α), preCdf ρ (-r) a ∂Measure.fst ρ) atTop (𝓝 (∫⁻ (a : α), F a ∂Measure.fst ρ))
⊢ (fun r => ∫⁻ (a : α), preCdf ρ (-r) a ∂Measure.fst ρ) = fun r => ↑↑ρ (univ ×ˢ Iic (-↑r))

Next tactic:
ext1 n
theorem inf_gt_preCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
    ∀ᵐ a ∂ρ.fst, ∀ t : ℚ, ⨅ r : Ioi t, preCdf ρ r a = preCdf ρ t a := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
inst✝ : IsFiniteMeasure ρ
⊢ ∀ᵐ (a : α) ∂Measure.fst ρ, ∀ (t : ℚ), ⨅ r, preCdf ρ (↑r) a = preCdf ρ t a

Next tactic:
rw [ae_all_iff]
theorem inf_gt_preCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
    ∀ᵐ a ∂ρ.fst, ∀ t : ℚ, ⨅ r : Ioi t, preCdf ρ r a = preCdf ρ t a := by
  rw [ae_all_iff]
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
inst✝ : IsFiniteMeasure ρ
⊢ ∀ (i : ℚ), ∀ᵐ (a : α) ∂Measure.fst ρ, ⨅ r, preCdf ρ (↑r) a = preCdf ρ i a

Next tactic:
refine' fun t => ae_eq_of_forall_set_lintegral_eq_of_sigmaFinite _ measurable_preCdf _
theorem inf_gt_preCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
    ∀ᵐ a ∂ρ.fst, ∀ t : ℚ, ⨅ r : Ioi t, preCdf ρ r a = preCdf ρ t a := by
  rw [ae_all_iff]
  refine' fun t => ae_eq_of_forall_set_lintegral_eq_of_sigmaFinite _ measurable_preCdf _
  · 

Proof state:
case refine'_1
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
inst✝ : IsFiniteMeasure ρ
t : ℚ
⊢ Measurable fun a => ⨅ r, preCdf ρ (↑r) a

Next tactic:
exact measurable_iInf fun i => measurable_preCdf
theorem inf_gt_preCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
    ∀ᵐ a ∂ρ.fst, ∀ t : ℚ, ⨅ r : Ioi t, preCdf ρ r a = preCdf ρ t a := by
  rw [ae_all_iff]
  refine' fun t => ae_eq_of_forall_set_lintegral_eq_of_sigmaFinite _ measurable_preCdf _
  · exact measurable_iInf fun i => measurable_preCdf
  

Proof state:
case refine'_2
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
inst✝ : IsFiniteMeasure ρ
t : ℚ
⊢ ∀ (s : Set α),
    MeasurableSet s →
      ↑↑(Measure.fst ρ) s < ⊤ →
        ∫⁻ (x : α) in s, ⨅ r, preCdf ρ (↑r) x ∂Measure.fst ρ = ∫⁻ (x : α) in s, preCdf ρ t x ∂Measure.fst ρ

Next tactic:
intro s hs _
theorem inf_gt_preCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
    ∀ᵐ a ∂ρ.fst, ∀ t : ℚ, ⨅ r : Ioi t, preCdf ρ r a = preCdf ρ t a := by
  rw [ae_all_iff]
  refine' fun t => ae_eq_of_forall_set_lintegral_eq_of_sigmaFinite _ measurable_preCdf _
  · exact measurable_iInf fun i => measurable_preCdf
  intro s hs _
  

Proof state:
case refine'_2
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
inst✝ : IsFiniteMeasure ρ
t : ℚ
s : Set α
hs : MeasurableSet s
a✝ : ↑↑(Measure.fst ρ) s < ⊤
⊢ ∫⁻ (x : α) in s, ⨅ r, preCdf ρ (↑r) x ∂Measure.fst ρ = ∫⁻ (x : α) in s, preCdf ρ t x ∂Measure.fst ρ

Next tactic:
rw [set_lintegral_iInf_gt_preCdf ρ t hs, set_lintegral_preCdf_fst ρ t hs]
theorem hasCondCdf_ae (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] : ∀ᵐ a ∂ρ.fst, HasCondCdf ρ a := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
inst✝ : IsFiniteMeasure ρ
⊢ ∀ᵐ (a : α) ∂Measure.fst ρ, HasCondCdf ρ a

Next tactic:
filter_upwards [monotone_preCdf ρ, preCdf_le_one ρ, tendsto_preCdf_atTop_one ρ,
    tendsto_preCdf_atBot_zero ρ, inf_gt_preCdf ρ] with a h1 h2 h3 h4 h5
theorem hasCondCdf_ae (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] : ∀ᵐ a ∂ρ.fst, HasCondCdf ρ a := by
  filter_upwards [monotone_preCdf ρ, preCdf_le_one ρ, tendsto_preCdf_atTop_one ρ,
    tendsto_preCdf_atBot_zero ρ, inf_gt_preCdf ρ] with a h1 h2 h3 h4 h5
  

Proof state:
case h
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
inst✝ : IsFiniteMeasure ρ
a : α
h1 : Monotone fun r => preCdf ρ r a
h2 : ∀ (r : ℚ), preCdf ρ r a ≤ 1
h3 : Tendsto (fun r => preCdf ρ r a) atTop (𝓝 1)
h4 : Tendsto (fun r => preCdf ρ r a) atBot (𝓝 0)
h5 : ∀ (t : ℚ), ⨅ r, preCdf ρ (↑r) a = preCdf ρ t a
⊢ HasCondCdf ρ a

Next tactic:
exact ⟨h1, h2, h3, h4, h5⟩
theorem hasCondCdf_of_mem_condCdfSet {ρ : Measure (α × ℝ)} {a : α} (h : a ∈ condCdfSet ρ) :
    HasCondCdf ρ a := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
a : α
h : a ∈ condCdfSet ρ
⊢ HasCondCdf ρ a

Next tactic:
rw [condCdfSet, mem_compl_iff] at h
theorem hasCondCdf_of_mem_condCdfSet {ρ : Measure (α × ℝ)} {a : α} (h : a ∈ condCdfSet ρ) :
    HasCondCdf ρ a := by
  rw [condCdfSet, mem_compl_iff] at h
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
a : α
h : a ∉ toMeasurable (Measure.fst ρ) {b | ¬HasCondCdf ρ b}
⊢ HasCondCdf ρ a

Next tactic:
have h_ss := subset_toMeasurable ρ.fst {b | ¬HasCondCdf ρ b}
theorem hasCondCdf_of_mem_condCdfSet {ρ : Measure (α × ℝ)} {a : α} (h : a ∈ condCdfSet ρ) :
    HasCondCdf ρ a := by
  rw [condCdfSet, mem_compl_iff] at h
  have h_ss := subset_toMeasurable ρ.fst {b | ¬HasCondCdf ρ b}
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
a : α
h : a ∉ toMeasurable (Measure.fst ρ) {b | ¬HasCondCdf ρ b}
h_ss : {b | ¬HasCondCdf ρ b} ⊆ toMeasurable (Measure.fst ρ) {b | ¬HasCondCdf ρ b}
⊢ HasCondCdf ρ a

Next tactic:
by_contra ha
theorem hasCondCdf_of_mem_condCdfSet {ρ : Measure (α × ℝ)} {a : α} (h : a ∈ condCdfSet ρ) :
    HasCondCdf ρ a := by
  rw [condCdfSet, mem_compl_iff] at h
  have h_ss := subset_toMeasurable ρ.fst {b | ¬HasCondCdf ρ b}
  by_contra ha
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
a : α
h : a ∉ toMeasurable (Measure.fst ρ) {b | ¬HasCondCdf ρ b}
h_ss : {b | ¬HasCondCdf ρ b} ⊆ toMeasurable (Measure.fst ρ) {b | ¬HasCondCdf ρ b}
ha : ¬HasCondCdf ρ a
⊢ False

Next tactic:
exact h (h_ss ha)
theorem mem_condCdfSet_ae (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
    ∀ᵐ a ∂ρ.fst, a ∈ condCdfSet ρ := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
inst✝ : IsFiniteMeasure ρ
⊢ ∀ᵐ (a : α) ∂Measure.fst ρ, a ∈ condCdfSet ρ

Next tactic:
simp_rw [ae_iff, condCdfSet, not_mem_compl_iff, setOf_mem_eq, measure_toMeasurable]
theorem mem_condCdfSet_ae (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
    ∀ᵐ a ∂ρ.fst, a ∈ condCdfSet ρ := by
  simp_rw [ae_iff, condCdfSet, not_mem_compl_iff, setOf_mem_eq, measure_toMeasurable]
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
inst✝ : IsFiniteMeasure ρ
⊢ ↑↑(Measure.fst ρ) {b | ¬HasCondCdf ρ b} = 0

Next tactic:
exact hasCondCdf_ae ρ
theorem condCdfRat_of_not_mem (ρ : Measure (α × ℝ)) (a : α) (h : a ∉ condCdfSet ρ) {r : ℚ} :
    condCdfRat ρ a r = if r < 0 then 0 else 1 := by 

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
a : α
h : a ∉ condCdfSet ρ
r : ℚ
⊢ condCdfRat ρ a r = if r < 0 then 0 else 1

Next tactic:
simp only [condCdfRat, h, if_false]
theorem condCdfRat_of_mem (ρ : Measure (α × ℝ)) (a : α) (h : a ∈ condCdfSet ρ) (r : ℚ) :
    condCdfRat ρ a r = (preCdf ρ r a).toReal := by 

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
a : α
h : a ∈ condCdfSet ρ
r : ℚ
⊢ condCdfRat ρ a r = ENNReal.toReal (preCdf ρ r a)

Next tactic:
simp only [condCdfRat, h, if_true]
theorem monotone_condCdfRat (ρ : Measure (α × ℝ)) (a : α) : Monotone (condCdfRat ρ a) := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
a : α
⊢ Monotone (condCdfRat ρ a)

Next tactic:
by_cases h : a ∈ condCdfSet ρ
theorem monotone_condCdfRat (ρ : Measure (α × ℝ)) (a : α) : Monotone (condCdfRat ρ a) := by
  by_cases h : a ∈ condCdfSet ρ
  · 

Proof state:
case pos
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
a : α
h : a ∈ condCdfSet ρ
⊢ Monotone (condCdfRat ρ a)

Next tactic:
simp only [condCdfRat, h, if_true, forall_const, and_self_iff]
theorem monotone_condCdfRat (ρ : Measure (α × ℝ)) (a : α) : Monotone (condCdfRat ρ a) := by
  by_cases h : a ∈ condCdfSet ρ
  · simp only [condCdfRat, h, if_true, forall_const, and_self_iff]
    

Proof state:
case pos
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
a : α
h : a ∈ condCdfSet ρ
⊢ Monotone fun r => ENNReal.toReal (preCdf ρ r a)

Next tactic:
intro r r' hrr'
theorem monotone_condCdfRat (ρ : Measure (α × ℝ)) (a : α) : Monotone (condCdfRat ρ a) := by
  by_cases h : a ∈ condCdfSet ρ
  · simp only [condCdfRat, h, if_true, forall_const, and_self_iff]
    intro r r' hrr'
    

Proof state:
case pos
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
a : α
h : a ∈ condCdfSet ρ
r r' : ℚ
hrr' : r ≤ r'
⊢ (fun r => ENNReal.toReal (preCdf ρ r a)) r ≤ (fun r => ENNReal.toReal (preCdf ρ r a)) r'

Next tactic:
have h' := hasCondCdf_of_mem_condCdfSet h
theorem monotone_condCdfRat (ρ : Measure (α × ℝ)) (a : α) : Monotone (condCdfRat ρ a) := by
  by_cases h : a ∈ condCdfSet ρ
  · simp only [condCdfRat, h, if_true, forall_const, and_self_iff]
    intro r r' hrr'
    have h' := hasCondCdf_of_mem_condCdfSet h
    

Proof state:
case pos
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
a : α
h : a ∈ condCdfSet ρ
r r' : ℚ
hrr' : r ≤ r'
h' : HasCondCdf ρ a
⊢ (fun r => ENNReal.toReal (preCdf ρ r a)) r ≤ (fun r => ENNReal.toReal (preCdf ρ r a)) r'

Next tactic:
have h_ne_top : ∀ r, preCdf ρ r a ≠ ∞ := fun r =>
      ((h'.le_one r).trans_lt ENNReal.one_lt_top).ne
theorem monotone_condCdfRat (ρ : Measure (α × ℝ)) (a : α) : Monotone (condCdfRat ρ a) := by
  by_cases h : a ∈ condCdfSet ρ
  · simp only [condCdfRat, h, if_true, forall_const, and_self_iff]
    intro r r' hrr'
    have h' := hasCondCdf_of_mem_condCdfSet h
    have h_ne_top : ∀ r, preCdf ρ r a ≠ ∞ := fun r =>
      ((h'.le_one r).trans_lt ENNReal.one_lt_top).ne
    

Proof state:
case pos
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
a : α
h : a ∈ condCdfSet ρ
r r' : ℚ
hrr' : r ≤ r'
h' : HasCondCdf ρ a
h_ne_top : ∀ (r : ℚ), preCdf ρ r a ≠ ⊤
⊢ (fun r => ENNReal.toReal (preCdf ρ r a)) r ≤ (fun r => ENNReal.toReal (preCdf ρ r a)) r'

Next tactic:
rw [ENNReal.toReal_le_toReal (h_ne_top _) (h_ne_top _)]
theorem monotone_condCdfRat (ρ : Measure (α × ℝ)) (a : α) : Monotone (condCdfRat ρ a) := by
  by_cases h : a ∈ condCdfSet ρ
  · simp only [condCdfRat, h, if_true, forall_const, and_self_iff]
    intro r r' hrr'
    have h' := hasCondCdf_of_mem_condCdfSet h
    have h_ne_top : ∀ r, preCdf ρ r a ≠ ∞ := fun r =>
      ((h'.le_one r).trans_lt ENNReal.one_lt_top).ne
    rw [ENNReal.toReal_le_toReal (h_ne_top _) (h_ne_top _)]
    

Proof state:
case pos
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
a : α
h : a ∈ condCdfSet ρ
r r' : ℚ
hrr' : r ≤ r'
h' : HasCondCdf ρ a
h_ne_top : ∀ (r : ℚ), preCdf ρ r a ≠ ⊤
⊢ preCdf ρ r a ≤ preCdf ρ r' a

Next tactic:
exact h'.1 hrr'
theorem monotone_condCdfRat (ρ : Measure (α × ℝ)) (a : α) : Monotone (condCdfRat ρ a) := by
  by_cases h : a ∈ condCdfSet ρ
  · simp only [condCdfRat, h, if_true, forall_const, and_self_iff]
    intro r r' hrr'
    have h' := hasCondCdf_of_mem_condCdfSet h
    have h_ne_top : ∀ r, preCdf ρ r a ≠ ∞ := fun r =>
      ((h'.le_one r).trans_lt ENNReal.one_lt_top).ne
    rw [ENNReal.toReal_le_toReal (h_ne_top _) (h_ne_top _)]
    exact h'.1 hrr'
  · 

Proof state:
case neg
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
a : α
h : a ∉ condCdfSet ρ
⊢ Monotone (condCdfRat ρ a)

Next tactic:
simp only [condCdfRat, h, if_false]
theorem monotone_condCdfRat (ρ : Measure (α × ℝ)) (a : α) : Monotone (condCdfRat ρ a) := by
  by_cases h : a ∈ condCdfSet ρ
  · simp only [condCdfRat, h, if_true, forall_const, and_self_iff]
    intro r r' hrr'
    have h' := hasCondCdf_of_mem_condCdfSet h
    have h_ne_top : ∀ r, preCdf ρ r a ≠ ∞ := fun r =>
      ((h'.le_one r).trans_lt ENNReal.one_lt_top).ne
    rw [ENNReal.toReal_le_toReal (h_ne_top _) (h_ne_top _)]
    exact h'.1 hrr'
  · simp only [condCdfRat, h, if_false]
    

Proof state:
case neg
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
a : α
h : a ∉ condCdfSet ρ
⊢ Monotone fun r => if r < 0 then 0 else 1

Next tactic:
intro x y hxy
theorem monotone_condCdfRat (ρ : Measure (α × ℝ)) (a : α) : Monotone (condCdfRat ρ a) := by
  by_cases h : a ∈ condCdfSet ρ
  · simp only [condCdfRat, h, if_true, forall_const, and_self_iff]
    intro r r' hrr'
    have h' := hasCondCdf_of_mem_condCdfSet h
    have h_ne_top : ∀ r, preCdf ρ r a ≠ ∞ := fun r =>
      ((h'.le_one r).trans_lt ENNReal.one_lt_top).ne
    rw [ENNReal.toReal_le_toReal (h_ne_top _) (h_ne_top _)]
    exact h'.1 hrr'
  · simp only [condCdfRat, h, if_false]
    intro x y hxy
    

Proof state:
case neg
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
a : α
h : a ∉ condCdfSet ρ
x y : ℚ
hxy : x ≤ y
⊢ (fun r => if r < 0 then 0 else 1) x ≤ (fun r => if r < 0 then 0 else 1) y

Next tactic:
dsimp only
theorem monotone_condCdfRat (ρ : Measure (α × ℝ)) (a : α) : Monotone (condCdfRat ρ a) := by
  by_cases h : a ∈ condCdfSet ρ
  · simp only [condCdfRat, h, if_true, forall_const, and_self_iff]
    intro r r' hrr'
    have h' := hasCondCdf_of_mem_condCdfSet h
    have h_ne_top : ∀ r, preCdf ρ r a ≠ ∞ := fun r =>
      ((h'.le_one r).trans_lt ENNReal.one_lt_top).ne
    rw [ENNReal.toReal_le_toReal (h_ne_top _) (h_ne_top _)]
    exact h'.1 hrr'
  · simp only [condCdfRat, h, if_false]
    intro x y hxy
    dsimp only
    

Proof state:
case neg
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
a : α
h : a ∉ condCdfSet ρ
x y : ℚ
hxy : x ≤ y
⊢ (if x < 0 then 0 else 1) ≤ if y < 0 then 0 else 1

Next tactic:
split_ifs with h_1 h_2 h_2
theorem monotone_condCdfRat (ρ : Measure (α × ℝ)) (a : α) : Monotone (condCdfRat ρ a) := by
  by_cases h : a ∈ condCdfSet ρ
  · simp only [condCdfRat, h, if_true, forall_const, and_self_iff]
    intro r r' hrr'
    have h' := hasCondCdf_of_mem_condCdfSet h
    have h_ne_top : ∀ r, preCdf ρ r a ≠ ∞ := fun r =>
      ((h'.le_one r).trans_lt ENNReal.one_lt_top).ne
    rw [ENNReal.toReal_le_toReal (h_ne_top _) (h_ne_top _)]
    exact h'.1 hrr'
  · simp only [condCdfRat, h, if_false]
    intro x y hxy
    dsimp only
    split_ifs with h_1 h_2 h_2
    

Proof state:
case pos
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
a : α
h : a ∉ condCdfSet ρ
x y : ℚ
hxy : x ≤ y
h_1 : x < 0
h_2 : y < 0
⊢ 0 ≤ 0
case neg
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
a : α
h : a ∉ condCdfSet ρ
x y : ℚ
hxy : x ≤ y
h_1 : x < 0
h_2 : ¬y < 0
⊢ 0 ≤ 1
case pos
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
a : α
h : a ∉ condCdfSet ρ
x y : ℚ
hxy : x ≤ y
h_1 : ¬x < 0
h_2 : y < 0
⊢ 1 ≤ 0
case neg
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
a : α
h : a ∉ condCdfSet ρ
x y : ℚ
hxy : x ≤ y
h_1 : ¬x < 0
h_2 : ¬y < 0
⊢ 1 ≤ 1

Next tactic:
exacts [le_rfl, zero_le_one, absurd (hxy.trans_lt h_2) h_1, le_rfl]
theorem measurable_condCdfRat (ρ : Measure (α × ℝ)) (q : ℚ) :
    Measurable fun a => condCdfRat ρ a q := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
q : ℚ
⊢ Measurable fun a => condCdfRat ρ a q

Next tactic:
simp_rw [condCdfRat, ite_apply]
theorem measurable_condCdfRat (ρ : Measure (α × ℝ)) (q : ℚ) :
    Measurable fun a => condCdfRat ρ a q := by
  simp_rw [condCdfRat, ite_apply]
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
q : ℚ
⊢ Measurable fun a => if a ∈ condCdfSet ρ then ENNReal.toReal (preCdf ρ q a) else if q < 0 then 0 else 1

Next tactic:
exact
    Measurable.ite (measurableSet_condCdfSet ρ) measurable_preCdf.ennreal_toReal
      measurable_const
theorem condCdfRat_nonneg (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) : 0 ≤ condCdfRat ρ a r := by
  -- Porting note: was
  -- unfold condCdfRat; split_ifs; exacts [ENNReal.toReal_nonneg, le_rfl, zero_le_one]
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
a : α
r : ℚ
⊢ 0 ≤ condCdfRat ρ a r

Next tactic:
unfold condCdfRat
theorem condCdfRat_nonneg (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) : 0 ≤ condCdfRat ρ a r := by
  -- Porting note: was
  -- unfold condCdfRat; split_ifs; exacts [ENNReal.toReal_nonneg, le_rfl, zero_le_one]
  unfold condCdfRat; 

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
a : α
r : ℚ
⊢ 0 ≤ ite (a ∈ condCdfSet ρ) (fun r => ENNReal.toReal (preCdf ρ r a)) (fun r => if r < 0 then 0 else 1) r

Next tactic:
split_ifs
theorem condCdfRat_nonneg (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) : 0 ≤ condCdfRat ρ a r := by
  -- Porting note: was
  -- unfold condCdfRat; split_ifs; exacts [ENNReal.toReal_nonneg, le_rfl, zero_le_one]
  unfold condCdfRat; split_ifs
  · 

Proof state:
case pos
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
a : α
r : ℚ
h✝ : a ∈ condCdfSet ρ
⊢ 0 ≤ (fun r => ENNReal.toReal (preCdf ρ r a)) r

Next tactic:
exact ENNReal.toReal_nonneg
theorem condCdfRat_nonneg (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) : 0 ≤ condCdfRat ρ a r := by
  -- Porting note: was
  -- unfold condCdfRat; split_ifs; exacts [ENNReal.toReal_nonneg, le_rfl, zero_le_one]
  unfold condCdfRat; split_ifs
  · exact ENNReal.toReal_nonneg
  

Proof state:
case neg
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
a : α
r : ℚ
h✝ : a ∉ condCdfSet ρ
⊢ 0 ≤ (fun r => if r < 0 then 0 else 1) r

Next tactic:
dsimp only
theorem condCdfRat_nonneg (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) : 0 ≤ condCdfRat ρ a r := by
  -- Porting note: was
  -- unfold condCdfRat; split_ifs; exacts [ENNReal.toReal_nonneg, le_rfl, zero_le_one]
  unfold condCdfRat; split_ifs
  · exact ENNReal.toReal_nonneg
  dsimp only
  

Proof state:
case neg
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
a : α
r : ℚ
h✝ : a ∉ condCdfSet ρ
⊢ 0 ≤ if r < 0 then 0 else 1

Next tactic:
split_ifs
theorem condCdfRat_nonneg (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) : 0 ≤ condCdfRat ρ a r := by
  -- Porting note: was
  -- unfold condCdfRat; split_ifs; exacts [ENNReal.toReal_nonneg, le_rfl, zero_le_one]
  unfold condCdfRat; split_ifs
  · exact ENNReal.toReal_nonneg
  dsimp only
  split_ifs
  

Proof state:
case pos
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
a : α
r : ℚ
h✝¹ : a ∉ condCdfSet ρ
h✝ : r < 0
⊢ 0 ≤ 0
case neg
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
a : α
r : ℚ
h✝¹ : a ∉ condCdfSet ρ
h✝ : ¬r < 0
⊢ 0 ≤ 1

Next tactic:
exacts [le_rfl, zero_le_one]
theorem condCdfRat_le_one (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) : condCdfRat ρ a r ≤ 1 := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
a : α
r : ℚ
⊢ condCdfRat ρ a r ≤ 1

Next tactic:
unfold condCdfRat
theorem condCdfRat_le_one (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) : condCdfRat ρ a r ≤ 1 := by
  unfold condCdfRat
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
a : α
r : ℚ
⊢ ite (a ∈ condCdfSet ρ) (fun r => ENNReal.toReal (preCdf ρ r a)) (fun r => if r < 0 then 0 else 1) r ≤ 1

Next tactic:
split_ifs with h
theorem condCdfRat_le_one (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) : condCdfRat ρ a r ≤ 1 := by
  unfold condCdfRat
  split_ifs with h
  · 

Proof state:
case pos
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
a : α
r : ℚ
h : a ∈ condCdfSet ρ
⊢ (fun r => ENNReal.toReal (preCdf ρ r a)) r ≤ 1

Next tactic:
refine' ENNReal.toReal_le_of_le_ofReal zero_le_one _
theorem condCdfRat_le_one (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) : condCdfRat ρ a r ≤ 1 := by
  unfold condCdfRat
  split_ifs with h
  · refine' ENNReal.toReal_le_of_le_ofReal zero_le_one _
    

Proof state:
case pos
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
a : α
r : ℚ
h : a ∈ condCdfSet ρ
⊢ preCdf ρ r a ≤ ENNReal.ofReal 1

Next tactic:
rw [ENNReal.ofReal_one]
theorem condCdfRat_le_one (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) : condCdfRat ρ a r ≤ 1 := by
  unfold condCdfRat
  split_ifs with h
  · refine' ENNReal.toReal_le_of_le_ofReal zero_le_one _
    rw [ENNReal.ofReal_one]
    

Proof state:
case pos
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
a : α
r : ℚ
h : a ∈ condCdfSet ρ
⊢ preCdf ρ r a ≤ 1

Next tactic:
exact (hasCondCdf_of_mem_condCdfSet h).le_one r
theorem condCdfRat_le_one (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) : condCdfRat ρ a r ≤ 1 := by
  unfold condCdfRat
  split_ifs with h
  · refine' ENNReal.toReal_le_of_le_ofReal zero_le_one _
    rw [ENNReal.ofReal_one]
    exact (hasCondCdf_of_mem_condCdfSet h).le_one r
  -- Porting note: added
  

Proof state:
case neg
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
a : α
r : ℚ
h : a ∉ condCdfSet ρ
⊢ (fun r => if r < 0 then 0 else 1) r ≤ 1

Next tactic:
dsimp only