l3lab/ntp-mathlib huggingface dataset:
theorem exists_eventually_forall_measure_closedBall_le_mul (K : ℝ) :
    ∃ C : ℝ≥0,
      ∀ᶠ ε in 𝓝[>] 0, ∀ (x t) (_ : t ≤ K), μ (closedBall x (t * ε)) ≤ C * μ (closedBall x ε) := by
  let C := doublingConstant μ
  have hμ :
    ∀ n : ℕ, ∀ᶠ ε in 𝓝[>] 0, ∀ x,
      μ (closedBall x ((2 : ℝ) ^ n * ε)) ≤ ↑(C ^ n) * μ (closedBall x ε) := by
    intro n
    induction' n with n ih
    · simp
    replace ih := eventually_nhdsWithin_pos_mul_left (two_pos : 0 < (2 : ℝ)) ih
    refine' (ih.and (exists_measure_closedBall_le_mul' μ)).mono fun ε hε x => _
    calc
      μ (closedBall x ((2 : ℝ) ^ (n + 1) * ε)) = μ (closedBall x ((2 : ℝ) ^ n * (2 * ε))) := by
        rw [pow_succ', mul_assoc]
      _ ≤ ↑(C ^ n) * μ (closedBall x (2 * ε)) := (hε.1 x)
      _ ≤ ↑(C ^ n) * (C * μ (closedBall x ε)) := by gcongr; exact hε.2 x
      _ = ↑(C ^ (n + 1)) * μ (closedBall x ε) := by rw [← mul_assoc, pow_succ', ENNReal.coe_mul]
  rcases lt_or_le K 1 with (hK | hK)
  · refine' ⟨1, _⟩
    simp only [ENNReal.coe_one, one_mul]
    exact
      eventually_mem_nhdsWithin.mono fun ε hε x t ht =>
        measure_mono <| closedBall_subset_closedBall (by nlinarith [mem_Ioi.mp hε])
  · refine'
      ⟨C ^ ⌈Real.logb 2 K⌉₊,
        ((hμ ⌈Real.logb 2 K⌉₊).and eventually_mem_nhdsWithin).mono fun ε hε x t ht =>
          le_trans (measure_mono <| closedBall_subset_closedBall _) (hε.1 x)⟩
    refine' mul_le_mul_of_nonneg_right (ht.trans _) (mem_Ioi.mp hε.2).le
    conv_lhs => rw [← Real.rpow_logb two_pos (by norm_num) (by linarith : 0 < K)]
    rw [← Real.rpow_nat_cast]
    

Proof state:
case inr
α : Type u_1
inst✝² : MetricSpace α
inst✝¹ : MeasurableSpace α
μ : Measure α
inst✝ : IsUnifLocDoublingMeasure μ
K : ℝ
C : ℝ≥0 := doublingConstant μ
hμ : ∀ (n : ℕ), ∀ᶠ (ε : ℝ) in 𝓝[>] 0, ∀ (x : α), ↑↑μ (closedBall x (2 ^ n * ε)) ≤ ↑(C ^ n) * ↑↑μ (closedBall x ε)
hK : 1 ≤ K
ε : ℝ
hε :
  (∀ (x : α), ↑↑μ (closedBall x (2 ^ ⌈Real.logb 2 K⌉₊ * ε)) ≤ ↑(C ^ ⌈Real.logb 2 K⌉₊) * ↑↑μ (closedBall x ε)) ∧
    ε ∈ Ioi 0
x : α
t : ℝ
ht : t ≤ K
⊢ 2 ^ Real.logb 2 K ≤ 2 ^ ↑⌈Real.logb 2 K⌉₊

Next tactic:
exact Real.rpow_le_rpow_of_exponent_le one_le_two (Nat.le_ceil (Real.logb 2 K))
theorem eventually_measure_mul_le_scalingConstantOf_mul (K : ℝ) :
    ∃ R : ℝ,
      0 < R ∧
        ∀ x t r, t ∈ Ioc 0 K → r ≤ R →
          μ (closedBall x (t * r)) ≤ scalingConstantOf μ K * μ (closedBall x r) := by
  

Proof state:
α : Type u_1
inst✝² : MetricSpace α
inst✝¹ : MeasurableSpace α
μ : Measure α
inst✝ : IsUnifLocDoublingMeasure μ
K : ℝ
⊢ ∃ R,
    0 < R ∧
      ∀ (x : α) (t r : ℝ),
        t ∈ Ioc 0 K → r ≤ R → ↑↑μ (closedBall x (t * r)) ≤ ↑(scalingConstantOf μ K) * ↑↑μ (closedBall x r)

Next tactic:
have h := Classical.choose_spec (exists_eventually_forall_measure_closedBall_le_mul μ K)
theorem eventually_measure_mul_le_scalingConstantOf_mul (K : ℝ) :
    ∃ R : ℝ,
      0 < R ∧
        ∀ x t r, t ∈ Ioc 0 K → r ≤ R →
          μ (closedBall x (t * r)) ≤ scalingConstantOf μ K * μ (closedBall x r) := by
  have h := Classical.choose_spec (exists_eventually_forall_measure_closedBall_le_mul μ K)
  

Proof state:
α : Type u_1
inst✝² : MetricSpace α
inst✝¹ : MeasurableSpace α
μ : Measure α
inst✝ : IsUnifLocDoublingMeasure μ
K : ℝ
h :
  ∀ᶠ (ε : ℝ) in 𝓝[>] 0,
    ∀ (x : α),
      ∀ t ≤ K,
        ↑↑μ (closedBall x (t * ε)) ≤
          ↑(Classical.choose
                (_ :
                  ∃ C,
                    ∀ᶠ (ε : ℝ) in 𝓝[>] 0, ∀ (x : α), ∀ t ≤ K, ↑↑μ (closedBall x (t * ε)) ≤ ↑C * ↑↑μ (closedBall x ε))) *
            ↑↑μ (closedBall x ε)
⊢ ∃ R,
    0 < R ∧
      ∀ (x : α) (t r : ℝ),
        t ∈ Ioc 0 K → r ≤ R → ↑↑μ (closedBall x (t * r)) ≤ ↑(scalingConstantOf μ K) * ↑↑μ (closedBall x r)

Next tactic:
rcases mem_nhdsWithin_Ioi_iff_exists_Ioc_subset.1 h with ⟨R, Rpos, hR⟩
theorem eventually_measure_mul_le_scalingConstantOf_mul (K : ℝ) :
    ∃ R : ℝ,
      0 < R ∧
        ∀ x t r, t ∈ Ioc 0 K → r ≤ R →
          μ (closedBall x (t * r)) ≤ scalingConstantOf μ K * μ (closedBall x r) := by
  have h := Classical.choose_spec (exists_eventually_forall_measure_closedBall_le_mul μ K)
  rcases mem_nhdsWithin_Ioi_iff_exists_Ioc_subset.1 h with ⟨R, Rpos, hR⟩
  

Proof state:
case intro.intro
α : Type u_1
inst✝² : MetricSpace α
inst✝¹ : MeasurableSpace α
μ : Measure α
inst✝ : IsUnifLocDoublingMeasure μ
K : ℝ
h :
  ∀ᶠ (ε : ℝ) in 𝓝[>] 0,
    ∀ (x : α),
      ∀ t ≤ K,
        ↑↑μ (closedBall x (t * ε)) ≤
          ↑(Classical.choose
                (_ :
                  ∃ C,
                    ∀ᶠ (ε : ℝ) in 𝓝[>] 0, ∀ (x : α), ∀ t ≤ K, ↑↑μ (closedBall x (t * ε)) ≤ ↑C * ↑↑μ (closedBall x ε))) *
            ↑↑μ (closedBall x ε)
R : ℝ
Rpos : R ∈ Ioi 0
hR :
  Ioc 0 R ⊆
    {x |
      (fun ε =>
          ∀ (x : α),
            ∀ t ≤ K,
              ↑↑μ (closedBall x (t * ε)) ≤
                ↑(Classical.choose
                      (_ :
                        ∃ C,
                          ∀ᶠ (ε : ℝ) in 𝓝[>] 0,
                            ∀ (x : α), ∀ t ≤ K, ↑↑μ (closedBall x (t * ε)) ≤ ↑C * ↑↑μ (closedBall x ε))) *
                  ↑↑μ (closedBall x ε))
        x}
⊢ ∃ R,
    0 < R ∧
      ∀ (x : α) (t r : ℝ),
        t ∈ Ioc 0 K → r ≤ R → ↑↑μ (closedBall x (t * r)) ≤ ↑(scalingConstantOf μ K) * ↑↑μ (closedBall x r)

Next tactic:
refine' ⟨R, Rpos, fun x t r ht hr => _⟩
theorem eventually_measure_mul_le_scalingConstantOf_mul (K : ℝ) :
    ∃ R : ℝ,
      0 < R ∧
        ∀ x t r, t ∈ Ioc 0 K → r ≤ R →
          μ (closedBall x (t * r)) ≤ scalingConstantOf μ K * μ (closedBall x r) := by
  have h := Classical.choose_spec (exists_eventually_forall_measure_closedBall_le_mul μ K)
  rcases mem_nhdsWithin_Ioi_iff_exists_Ioc_subset.1 h with ⟨R, Rpos, hR⟩
  refine' ⟨R, Rpos, fun x t r ht hr => _⟩
  

Proof state:
case intro.intro
α : Type u_1
inst✝² : MetricSpace α
inst✝¹ : MeasurableSpace α
μ : Measure α
inst✝ : IsUnifLocDoublingMeasure μ
K : ℝ
h :
  ∀ᶠ (ε : ℝ) in 𝓝[>] 0,
    ∀ (x : α),
      ∀ t ≤ K,
        ↑↑μ (closedBall x (t * ε)) ≤
          ↑(Classical.choose
                (_ :
                  ∃ C,
                    ∀ᶠ (ε : ℝ) in 𝓝[>] 0, ∀ (x : α), ∀ t ≤ K, ↑↑μ (closedBall x (t * ε)) ≤ ↑C * ↑↑μ (closedBall x ε))) *
            ↑↑μ (closedBall x ε)
R : ℝ
Rpos : R ∈ Ioi 0
hR :
  Ioc 0 R ⊆
    {x |
      (fun ε =>
          ∀ (x : α),
            ∀ t ≤ K,
              ↑↑μ (closedBall x (t * ε)) ≤
                ↑(Classical.choose
                      (_ :
                        ∃ C,
                          ∀ᶠ (ε : ℝ) in 𝓝[>] 0,
                            ∀ (x : α), ∀ t ≤ K, ↑↑μ (closedBall x (t * ε)) ≤ ↑C * ↑↑μ (closedBall x ε))) *
                  ↑↑μ (closedBall x ε))
        x}
x : α
t r : ℝ
ht : t ∈ Ioc 0 K
hr : r ≤ R
⊢ ↑↑μ (closedBall x (t * r)) ≤ ↑(scalingConstantOf μ K) * ↑↑μ (closedBall x r)

Next tactic:
rcases lt_trichotomy r 0 with (rneg | rfl | rpos)
theorem eventually_measure_mul_le_scalingConstantOf_mul (K : ℝ) :
    ∃ R : ℝ,
      0 < R ∧
        ∀ x t r, t ∈ Ioc 0 K → r ≤ R →
          μ (closedBall x (t * r)) ≤ scalingConstantOf μ K * μ (closedBall x r) := by
  have h := Classical.choose_spec (exists_eventually_forall_measure_closedBall_le_mul μ K)
  rcases mem_nhdsWithin_Ioi_iff_exists_Ioc_subset.1 h with ⟨R, Rpos, hR⟩
  refine' ⟨R, Rpos, fun x t r ht hr => _⟩
  rcases lt_trichotomy r 0 with (rneg | rfl | rpos)
  · 

Proof state:
case intro.intro.inl
α : Type u_1
inst✝² : MetricSpace α
inst✝¹ : MeasurableSpace α
μ : Measure α
inst✝ : IsUnifLocDoublingMeasure μ
K : ℝ
h :
  ∀ᶠ (ε : ℝ) in 𝓝[>] 0,
    ∀ (x : α),
      ∀ t ≤ K,
        ↑↑μ (closedBall x (t * ε)) ≤
          ↑(Classical.choose
                (_ :
                  ∃ C,
                    ∀ᶠ (ε : ℝ) in 𝓝[>] 0, ∀ (x : α), ∀ t ≤ K, ↑↑μ (closedBall x (t * ε)) ≤ ↑C * ↑↑μ (closedBall x ε))) *
            ↑↑μ (closedBall x ε)
R : ℝ
Rpos : R ∈ Ioi 0
hR :
  Ioc 0 R ⊆
    {x |
      (fun ε =>
          ∀ (x : α),
            ∀ t ≤ K,
              ↑↑μ (closedBall x (t * ε)) ≤
                ↑(Classical.choose
                      (_ :
                        ∃ C,
                          ∀ᶠ (ε : ℝ) in 𝓝[>] 0,
                            ∀ (x : α), ∀ t ≤ K, ↑↑μ (closedBall x (t * ε)) ≤ ↑C * ↑↑μ (closedBall x ε))) *
                  ↑↑μ (closedBall x ε))
        x}
x : α
t r : ℝ
ht : t ∈ Ioc 0 K
hr : r ≤ R
rneg : r < 0
⊢ ↑↑μ (closedBall x (t * r)) ≤ ↑(scalingConstantOf μ K) * ↑↑μ (closedBall x r)

Next tactic:
have : t * r < 0 := mul_neg_of_pos_of_neg ht.1 rneg
theorem eventually_measure_mul_le_scalingConstantOf_mul (K : ℝ) :
    ∃ R : ℝ,
      0 < R ∧
        ∀ x t r, t ∈ Ioc 0 K → r ≤ R →
          μ (closedBall x (t * r)) ≤ scalingConstantOf μ K * μ (closedBall x r) := by
  have h := Classical.choose_spec (exists_eventually_forall_measure_closedBall_le_mul μ K)
  rcases mem_nhdsWithin_Ioi_iff_exists_Ioc_subset.1 h with ⟨R, Rpos, hR⟩
  refine' ⟨R, Rpos, fun x t r ht hr => _⟩
  rcases lt_trichotomy r 0 with (rneg | rfl | rpos)
  · have : t * r < 0 := mul_neg_of_pos_of_neg ht.1 rneg
    

Proof state:
case intro.intro.inl
α : Type u_1
inst✝² : MetricSpace α
inst✝¹ : MeasurableSpace α
μ : Measure α
inst✝ : IsUnifLocDoublingMeasure μ
K : ℝ
h :
  ∀ᶠ (ε : ℝ) in 𝓝[>] 0,
    ∀ (x : α),
      ∀ t ≤ K,
        ↑↑μ (closedBall x (t * ε)) ≤
          ↑(Classical.choose
                (_ :
                  ∃ C,
                    ∀ᶠ (ε : ℝ) in 𝓝[>] 0, ∀ (x : α), ∀ t ≤ K, ↑↑μ (closedBall x (t * ε)) ≤ ↑C * ↑↑μ (closedBall x ε))) *
            ↑↑μ (closedBall x ε)
R : ℝ
Rpos : R ∈ Ioi 0
hR :
  Ioc 0 R ⊆
    {x |
      (fun ε =>
          ∀ (x : α),
            ∀ t ≤ K,
              ↑↑μ (closedBall x (t * ε)) ≤
                ↑(Classical.choose
                      (_ :
                        ∃ C,
                          ∀ᶠ (ε : ℝ) in 𝓝[>] 0,
                            ∀ (x : α), ∀ t ≤ K, ↑↑μ (closedBall x (t * ε)) ≤ ↑C * ↑↑μ (closedBall x ε))) *
                  ↑↑μ (closedBall x ε))
        x}
x : α
t r : ℝ
ht : t ∈ Ioc 0 K
hr : r ≤ R
rneg : r < 0
this : t * r < 0
⊢ ↑↑μ (closedBall x (t * r)) ≤ ↑(scalingConstantOf μ K) * ↑↑μ (closedBall x r)

Next tactic:
simp only [closedBall_eq_empty.2 this, measure_empty, zero_le']
theorem eventually_measure_mul_le_scalingConstantOf_mul (K : ℝ) :
    ∃ R : ℝ,
      0 < R ∧
        ∀ x t r, t ∈ Ioc 0 K → r ≤ R →
          μ (closedBall x (t * r)) ≤ scalingConstantOf μ K * μ (closedBall x r) := by
  have h := Classical.choose_spec (exists_eventually_forall_measure_closedBall_le_mul μ K)
  rcases mem_nhdsWithin_Ioi_iff_exists_Ioc_subset.1 h with ⟨R, Rpos, hR⟩
  refine' ⟨R, Rpos, fun x t r ht hr => _⟩
  rcases lt_trichotomy r 0 with (rneg | rfl | rpos)
  · have : t * r < 0 := mul_neg_of_pos_of_neg ht.1 rneg
    simp only [closedBall_eq_empty.2 this, measure_empty, zero_le']
  · 

Proof state:
case intro.intro.inr.inl
α : Type u_1
inst✝² : MetricSpace α
inst✝¹ : MeasurableSpace α
μ : Measure α
inst✝ : IsUnifLocDoublingMeasure μ
K : ℝ
h :
  ∀ᶠ (ε : ℝ) in 𝓝[>] 0,
    ∀ (x : α),
      ∀ t ≤ K,
        ↑↑μ (closedBall x (t * ε)) ≤
          ↑(Classical.choose
                (_ :
                  ∃ C,
                    ∀ᶠ (ε : ℝ) in 𝓝[>] 0, ∀ (x : α), ∀ t ≤ K, ↑↑μ (closedBall x (t * ε)) ≤ ↑C * ↑↑μ (closedBall x ε))) *
            ↑↑μ (closedBall x ε)
R : ℝ
Rpos : R ∈ Ioi 0
hR :
  Ioc 0 R ⊆
    {x |
      (fun ε =>
          ∀ (x : α),
            ∀ t ≤ K,
              ↑↑μ (closedBall x (t * ε)) ≤
                ↑(Classical.choose
                      (_ :
                        ∃ C,
                          ∀ᶠ (ε : ℝ) in 𝓝[>] 0,
                            ∀ (x : α), ∀ t ≤ K, ↑↑μ (closedBall x (t * ε)) ≤ ↑C * ↑↑μ (closedBall x ε))) *
                  ↑↑μ (closedBall x ε))
        x}
x : α
t : ℝ
ht : t ∈ Ioc 0 K
hr : 0 ≤ R
⊢ ↑↑μ (closedBall x (t * 0)) ≤ ↑(scalingConstantOf μ K) * ↑↑μ (closedBall x 0)

Next tactic:
simp only [mul_zero, closedBall_zero]
theorem eventually_measure_mul_le_scalingConstantOf_mul (K : ℝ) :
    ∃ R : ℝ,
      0 < R ∧
        ∀ x t r, t ∈ Ioc 0 K → r ≤ R →
          μ (closedBall x (t * r)) ≤ scalingConstantOf μ K * μ (closedBall x r) := by
  have h := Classical.choose_spec (exists_eventually_forall_measure_closedBall_le_mul μ K)
  rcases mem_nhdsWithin_Ioi_iff_exists_Ioc_subset.1 h with ⟨R, Rpos, hR⟩
  refine' ⟨R, Rpos, fun x t r ht hr => _⟩
  rcases lt_trichotomy r 0 with (rneg | rfl | rpos)
  · have : t * r < 0 := mul_neg_of_pos_of_neg ht.1 rneg
    simp only [closedBall_eq_empty.2 this, measure_empty, zero_le']
  · simp only [mul_zero, closedBall_zero]
    

Proof state:
case intro.intro.inr.inl
α : Type u_1
inst✝² : MetricSpace α
inst✝¹ : MeasurableSpace α
μ : Measure α
inst✝ : IsUnifLocDoublingMeasure μ
K : ℝ
h :
  ∀ᶠ (ε : ℝ) in 𝓝[>] 0,
    ∀ (x : α),
      ∀ t ≤ K,
        ↑↑μ (closedBall x (t * ε)) ≤
          ↑(Classical.choose
                (_ :
                  ∃ C,
                    ∀ᶠ (ε : ℝ) in 𝓝[>] 0, ∀ (x : α), ∀ t ≤ K, ↑↑μ (closedBall x (t * ε)) ≤ ↑C * ↑↑μ (closedBall x ε))) *
            ↑↑μ (closedBall x ε)
R : ℝ
Rpos : R ∈ Ioi 0
hR :
  Ioc 0 R ⊆
    {x |
      (fun ε =>
          ∀ (x : α),
            ∀ t ≤ K,
              ↑↑μ (closedBall x (t * ε)) ≤
                ↑(Classical.choose
                      (_ :
                        ∃ C,
                          ∀ᶠ (ε : ℝ) in 𝓝[>] 0,
                            ∀ (x : α), ∀ t ≤ K, ↑↑μ (closedBall x (t * ε)) ≤ ↑C * ↑↑μ (closedBall x ε))) *
                  ↑↑μ (closedBall x ε))
        x}
x : α
t : ℝ
ht : t ∈ Ioc 0 K
hr : 0 ≤ R
⊢ ↑↑μ {x} ≤ ↑(scalingConstantOf μ K) * ↑↑μ {x}

Next tactic:
refine' le_mul_of_one_le_of_le _ le_rfl
theorem eventually_measure_mul_le_scalingConstantOf_mul (K : ℝ) :
    ∃ R : ℝ,
      0 < R ∧
        ∀ x t r, t ∈ Ioc 0 K → r ≤ R →
          μ (closedBall x (t * r)) ≤ scalingConstantOf μ K * μ (closedBall x r) := by
  have h := Classical.choose_spec (exists_eventually_forall_measure_closedBall_le_mul μ K)
  rcases mem_nhdsWithin_Ioi_iff_exists_Ioc_subset.1 h with ⟨R, Rpos, hR⟩
  refine' ⟨R, Rpos, fun x t r ht hr => _⟩
  rcases lt_trichotomy r 0 with (rneg | rfl | rpos)
  · have : t * r < 0 := mul_neg_of_pos_of_neg ht.1 rneg
    simp only [closedBall_eq_empty.2 this, measure_empty, zero_le']
  · simp only [mul_zero, closedBall_zero]
    refine' le_mul_of_one_le_of_le _ le_rfl
    

Proof state:
case intro.intro.inr.inl
α : Type u_1
inst✝² : MetricSpace α
inst✝¹ : MeasurableSpace α
μ : Measure α
inst✝ : IsUnifLocDoublingMeasure μ
K : ℝ
h :
  ∀ᶠ (ε : ℝ) in 𝓝[>] 0,
    ∀ (x : α),
      ∀ t ≤ K,
        ↑↑μ (closedBall x (t * ε)) ≤
          ↑(Classical.choose
                (_ :
                  ∃ C,
                    ∀ᶠ (ε : ℝ) in 𝓝[>] 0, ∀ (x : α), ∀ t ≤ K, ↑↑μ (closedBall x (t * ε)) ≤ ↑C * ↑↑μ (closedBall x ε))) *
            ↑↑μ (closedBall x ε)
R : ℝ
Rpos : R ∈ Ioi 0
hR :
  Ioc 0 R ⊆
    {x |
      (fun ε =>
          ∀ (x : α),
            ∀ t ≤ K,
              ↑↑μ (closedBall x (t * ε)) ≤
                ↑(Classical.choose
                      (_ :
                        ∃ C,
                          ∀ᶠ (ε : ℝ) in 𝓝[>] 0,
                            ∀ (x : α), ∀ t ≤ K, ↑↑μ (closedBall x (t * ε)) ≤ ↑C * ↑↑μ (closedBall x ε))) *
                  ↑↑μ (closedBall x ε))
        x}
x : α
t : ℝ
ht : t ∈ Ioc 0 K
hr : 0 ≤ R
⊢ 1 ≤ ↑(scalingConstantOf μ K)

Next tactic:
apply ENNReal.one_le_coe_iff.2 (le_max_right _ _)
theorem eventually_measure_mul_le_scalingConstantOf_mul (K : ℝ) :
    ∃ R : ℝ,
      0 < R ∧
        ∀ x t r, t ∈ Ioc 0 K → r ≤ R →
          μ (closedBall x (t * r)) ≤ scalingConstantOf μ K * μ (closedBall x r) := by
  have h := Classical.choose_spec (exists_eventually_forall_measure_closedBall_le_mul μ K)
  rcases mem_nhdsWithin_Ioi_iff_exists_Ioc_subset.1 h with ⟨R, Rpos, hR⟩
  refine' ⟨R, Rpos, fun x t r ht hr => _⟩
  rcases lt_trichotomy r 0 with (rneg | rfl | rpos)
  · have : t * r < 0 := mul_neg_of_pos_of_neg ht.1 rneg
    simp only [closedBall_eq_empty.2 this, measure_empty, zero_le']
  · simp only [mul_zero, closedBall_zero]
    refine' le_mul_of_one_le_of_le _ le_rfl
    apply ENNReal.one_le_coe_iff.2 (le_max_right _ _)
  · 

Proof state:
case intro.intro.inr.inr
α : Type u_1
inst✝² : MetricSpace α
inst✝¹ : MeasurableSpace α
μ : Measure α
inst✝ : IsUnifLocDoublingMeasure μ
K : ℝ
h :
  ∀ᶠ (ε : ℝ) in 𝓝[>] 0,
    ∀ (x : α),
      ∀ t ≤ K,
        ↑↑μ (closedBall x (t * ε)) ≤
          ↑(Classical.choose
                (_ :
                  ∃ C,
                    ∀ᶠ (ε : ℝ) in 𝓝[>] 0, ∀ (x : α), ∀ t ≤ K, ↑↑μ (closedBall x (t * ε)) ≤ ↑C * ↑↑μ (closedBall x ε))) *
            ↑↑μ (closedBall x ε)
R : ℝ
Rpos : R ∈ Ioi 0
hR :
  Ioc 0 R ⊆
    {x |
      (fun ε =>
          ∀ (x : α),
            ∀ t ≤ K,
              ↑↑μ (closedBall x (t * ε)) ≤
                ↑(Classical.choose
                      (_ :
                        ∃ C,
                          ∀ᶠ (ε : ℝ) in 𝓝[>] 0,
                            ∀ (x : α), ∀ t ≤ K, ↑↑μ (closedBall x (t * ε)) ≤ ↑C * ↑↑μ (closedBall x ε))) *
                  ↑↑μ (closedBall x ε))
        x}
x : α
t r : ℝ
ht : t ∈ Ioc 0 K
hr : r ≤ R
rpos : 0 < r
⊢ ↑↑μ (closedBall x (t * r)) ≤ ↑(scalingConstantOf μ K) * ↑↑μ (closedBall x r)

Next tactic:
apply (hR ⟨rpos, hr⟩ x t ht.2).trans _
theorem eventually_measure_mul_le_scalingConstantOf_mul (K : ℝ) :
    ∃ R : ℝ,
      0 < R ∧
        ∀ x t r, t ∈ Ioc 0 K → r ≤ R →
          μ (closedBall x (t * r)) ≤ scalingConstantOf μ K * μ (closedBall x r) := by
  have h := Classical.choose_spec (exists_eventually_forall_measure_closedBall_le_mul μ K)
  rcases mem_nhdsWithin_Ioi_iff_exists_Ioc_subset.1 h with ⟨R, Rpos, hR⟩
  refine' ⟨R, Rpos, fun x t r ht hr => _⟩
  rcases lt_trichotomy r 0 with (rneg | rfl | rpos)
  · have : t * r < 0 := mul_neg_of_pos_of_neg ht.1 rneg
    simp only [closedBall_eq_empty.2 this, measure_empty, zero_le']
  · simp only [mul_zero, closedBall_zero]
    refine' le_mul_of_one_le_of_le _ le_rfl
    apply ENNReal.one_le_coe_iff.2 (le_max_right _ _)
  · apply (hR ⟨rpos, hr⟩ x t ht.2).trans _
    

Proof state:
α : Type u_1
inst✝² : MetricSpace α
inst✝¹ : MeasurableSpace α
μ : Measure α
inst✝ : IsUnifLocDoublingMeasure μ
K : ℝ
h :
  ∀ᶠ (ε : ℝ) in 𝓝[>] 0,
    ∀ (x : α),
      ∀ t ≤ K,
        ↑↑μ (closedBall x (t * ε)) ≤
          ↑(Classical.choose
                (_ :
                  ∃ C,
                    ∀ᶠ (ε : ℝ) in 𝓝[>] 0, ∀ (x : α), ∀ t ≤ K, ↑↑μ (closedBall x (t * ε)) ≤ ↑C * ↑↑μ (closedBall x ε))) *
            ↑↑μ (closedBall x ε)
R : ℝ
Rpos : R ∈ Ioi 0
hR :
  Ioc 0 R ⊆
    {x |
      (fun ε =>
          ∀ (x : α),
            ∀ t ≤ K,
              ↑↑μ (closedBall x (t * ε)) ≤
                ↑(Classical.choose
                      (_ :
                        ∃ C,
                          ∀ᶠ (ε : ℝ) in 𝓝[>] 0,
                            ∀ (x : α), ∀ t ≤ K, ↑↑μ (closedBall x (t * ε)) ≤ ↑C * ↑↑μ (closedBall x ε))) *
                  ↑↑μ (closedBall x ε))
        x}
x : α
t r : ℝ
ht : t ∈ Ioc 0 K
hr : r ≤ R
rpos : 0 < r
⊢ ↑(Classical.choose
          (_ : ∃ C, ∀ᶠ (ε : ℝ) in 𝓝[>] 0, ∀ (x : α), ∀ t ≤ K, ↑↑μ (closedBall x (t * ε)) ≤ ↑C * ↑↑μ (closedBall x ε))) *
      ↑↑μ (closedBall x r) ≤
    ↑(scalingConstantOf μ K) * ↑↑μ (closedBall x r)

Next tactic:
exact mul_le_mul_right' (ENNReal.coe_le_coe.2 (le_max_left _ _)) _
theorem eventually_measure_le_scaling_constant_mul (K : ℝ) :
    ∀ᶠ r in 𝓝[>] 0, ∀ x, μ (closedBall x (K * r)) ≤ scalingConstantOf μ K * μ (closedBall x r) := by
  

Proof state:
α : Type u_1
inst✝² : MetricSpace α
inst✝¹ : MeasurableSpace α
μ : Measure α
inst✝ : IsUnifLocDoublingMeasure μ
K : ℝ
⊢ ∀ᶠ (r : ℝ) in 𝓝[>] 0, ∀ (x : α), ↑↑μ (closedBall x (K * r)) ≤ ↑(scalingConstantOf μ K) * ↑↑μ (closedBall x r)

Next tactic:
filter_upwards [Classical.choose_spec
      (exists_eventually_forall_measure_closedBall_le_mul μ K)] with r hr x
theorem eventually_measure_le_scaling_constant_mul (K : ℝ) :
    ∀ᶠ r in 𝓝[>] 0, ∀ x, μ (closedBall x (K * r)) ≤ scalingConstantOf μ K * μ (closedBall x r) := by
  filter_upwards [Classical.choose_spec
      (exists_eventually_forall_measure_closedBall_le_mul μ K)] with r hr x
  

Proof state:
case h
α : Type u_1
inst✝² : MetricSpace α
inst✝¹ : MeasurableSpace α
μ : Measure α
inst✝ : IsUnifLocDoublingMeasure μ
K r : ℝ
hr :
  ∀ (x : α),
    ∀ t ≤ K,
      ↑↑μ (closedBall x (t * r)) ≤
        ↑(Classical.choose
              (_ :
                ∃ C,
                  ∀ᶠ (ε : ℝ) in 𝓝[>] 0, ∀ (x : α), ∀ t ≤ K, ↑↑μ (closedBall x (t * ε)) ≤ ↑C * ↑↑μ (closedBall x ε))) *
          ↑↑μ (closedBall x r)
x : α
⊢ ↑↑μ (closedBall x (K * r)) ≤ ↑(scalingConstantOf μ K) * ↑↑μ (closedBall x r)

Next tactic:
exact (hr x K le_rfl).trans (mul_le_mul_right' (ENNReal.coe_le_coe.2 (le_max_left _ _)) _)
theorem eventually_measure_le_scaling_constant_mul' (K : ℝ) (hK : 0 < K) :
    ∀ᶠ r in 𝓝[>] 0, ∀ x,
      μ (closedBall x r) ≤ scalingConstantOf μ K⁻¹ * μ (closedBall x (K * r)) := by
  

Proof state:
α : Type u_1
inst✝² : MetricSpace α
inst✝¹ : MeasurableSpace α
μ : Measure α
inst✝ : IsUnifLocDoublingMeasure μ
K : ℝ
hK : 0 < K
⊢ ∀ᶠ (r : ℝ) in 𝓝[>] 0, ∀ (x : α), ↑↑μ (closedBall x r) ≤ ↑(scalingConstantOf μ K⁻¹) * ↑↑μ (closedBall x (K * r))

Next tactic:
convert eventually_nhdsWithin_pos_mul_left hK (eventually_measure_le_scaling_constant_mul μ K⁻¹)
theorem eventually_measure_le_scaling_constant_mul' (K : ℝ) (hK : 0 < K) :
    ∀ᶠ r in 𝓝[>] 0, ∀ x,
      μ (closedBall x r) ≤ scalingConstantOf μ K⁻¹ * μ (closedBall x (K * r)) := by
  convert eventually_nhdsWithin_pos_mul_left hK (eventually_measure_le_scaling_constant_mul μ K⁻¹)
  

Proof state:
case h.e'_2.h.h.h.e'_3.h.e'_3.h.e'_4
α : Type u_1
inst✝² : MetricSpace α
inst✝¹ : MeasurableSpace α
μ : Measure α
inst✝ : IsUnifLocDoublingMeasure μ
K : ℝ
hK : 0 < K
x✝ : ℝ
a✝ : α
⊢ x✝ = K⁻¹ * (K * x✝)

Next tactic:
simp [inv_mul_cancel_left₀ hK.ne']
@[measurability]
theorem Finset.measurable_range_sup' {f : ℕ → δ → α} {n : ℕ} (hf : ∀ k ≤ n, Measurable (f k)) :
    Measurable ((range (n + 1)).sup' nonempty_range_succ f) := by
  

Proof state:
M : Type u_1
inst✝³ : MeasurableSpace M
α : Type u_2
m : MeasurableSpace α
μ : Measure α
f✝ g : α → M
δ : Type u_3
inst✝² : MeasurableSpace δ
inst✝¹ : SemilatticeSup α
inst✝ : MeasurableSup₂ α
f : ℕ → δ → α
n : ℕ
hf : ∀ k ≤ n, Measurable (f k)
⊢ Measurable (sup' (range (n + 1)) (_ : Finset.Nonempty (range (n + 1))) f)

Next tactic:
simp_rw [← Nat.lt_succ_iff] at hf
@[measurability]
theorem Finset.measurable_range_sup' {f : ℕ → δ → α} {n : ℕ} (hf : ∀ k ≤ n, Measurable (f k)) :
    Measurable ((range (n + 1)).sup' nonempty_range_succ f) := by
  simp_rw [← Nat.lt_succ_iff] at hf
  

Proof state:
M : Type u_1
inst✝³ : MeasurableSpace M
α : Type u_2
m : MeasurableSpace α
μ : Measure α
f✝ g : α → M
δ : Type u_3
inst✝² : MeasurableSpace δ
inst✝¹ : SemilatticeSup α
inst✝ : MeasurableSup₂ α
f : ℕ → δ → α
n : ℕ
hf : ∀ k < Nat.succ n, Measurable (f k)
⊢ Measurable (sup' (range (n + 1)) (_ : Finset.Nonempty (range (n + 1))) f)

Next tactic:
refine' Finset.measurable_sup' _ _
@[measurability]
theorem Finset.measurable_range_sup' {f : ℕ → δ → α} {n : ℕ} (hf : ∀ k ≤ n, Measurable (f k)) :
    Measurable ((range (n + 1)).sup' nonempty_range_succ f) := by
  simp_rw [← Nat.lt_succ_iff] at hf
  refine' Finset.measurable_sup' _ _
  

Proof state:
M : Type u_1
inst✝³ : MeasurableSpace M
α : Type u_2
m : MeasurableSpace α
μ : Measure α
f✝ g : α → M
δ : Type u_3
inst✝² : MeasurableSpace δ
inst✝¹ : SemilatticeSup α
inst✝ : MeasurableSup₂ α
f : ℕ → δ → α
n : ℕ
hf : ∀ k < Nat.succ n, Measurable (f k)
⊢ ∀ n_1 ∈ range (n + 1), Measurable (f n_1)

Next tactic:
simpa [Finset.mem_range]
@[measurability]
theorem Finset.measurable_range_sup'' {f : ℕ → δ → α} {n : ℕ} (hf : ∀ k ≤ n, Measurable (f k)) :
    Measurable fun x => (range (n + 1)).sup' nonempty_range_succ fun k => f k x := by
  

Proof state:
M : Type u_1
inst✝³ : MeasurableSpace M
α : Type u_2
m : MeasurableSpace α
μ : Measure α
f✝ g : α → M
δ : Type u_3
inst✝² : MeasurableSpace δ
inst✝¹ : SemilatticeSup α
inst✝ : MeasurableSup₂ α
f : ℕ → δ → α
n : ℕ
hf : ∀ k ≤ n, Measurable (f k)
⊢ Measurable fun x => sup' (range (n + 1)) (_ : Finset.Nonempty (range (n + 1))) fun k => f k x

Next tactic:
convert Finset.measurable_range_sup' hf using 1