Theorem: UpperHalfPlane.cmp_dist_eq_cmp_dist_coe_center
File: Mathlib/Analysis/Complex/UpperHalfPlane/Metric.lean

tactic: letI := metricSpaceAux
state_before: z✝ w✝ : ℍ
r✝ R : ℝ
z w : ℍ
r : ℝ
⊢ cmp (dist z w) r = cmp (dist ↑z ↑(w.center r)) (w.im * Real.sinh r)
state_after: z✝ w✝ : ℍ
r✝ R : ℝ
z w : ℍ
r : ℝ
this : MetricSpace ℍ := metricSpaceAux
⊢ cmp (dist z w) r = cmp (dist ↑z ↑(w.center r)) (w.im * Real.sinh r)

tactic: cases' lt_or_le r 0 with hr₀ hr₀
state_before: z✝ w✝ : ℍ
r✝ R : ℝ
z w : ℍ
r : ℝ
this : MetricSpace ℍ := metricSpaceAux
⊢ cmp (dist z w) r = cmp (dist ↑z ↑(w.center r)) (w.im * Real.sinh r)
state_after: case inl
z✝ w✝ : ℍ
r✝ R : ℝ
z w : ℍ
r : ℝ
this : MetricSpace ℍ := metricSpaceAux
hr₀ : r < 0
⊢ cmp (dist z w) r = cmp (dist ↑z ↑(w.center r)) (w.im * Real.sinh r)

case inr
z✝ w✝ : ℍ
r✝ R : ℝ
z w : ℍ
r : ℝ
this : MetricSpace ℍ := metricSpaceAux
hr₀ : 0 ≤ r
⊢ cmp (dist z w) r = cmp (dist ↑z ↑(w.center r)) (w.im * Real.sinh r)

tactic: have hr₀' : 0 ≤ w.im * Real.sinh r := by positivity
state_before: case inr
z✝ w✝ : ℍ
r✝ R : ℝ
z w : ℍ
r : ℝ
this : MetricSpace ℍ := metricSpaceAux
hr₀ : 0 ≤ r
⊢ cmp (dist z w) r = cmp (dist ↑z ↑(w.center r)) (w.im * Real.sinh r)
state_after: case inr
z✝ w✝ : ℍ
r✝ R : ℝ
z w : ℍ
r : ℝ
this : MetricSpace ℍ := metricSpaceAux
hr₀ : 0 ≤ r
hr₀' : 0 ≤ w.im * Real.sinh r
⊢ cmp (dist z w) r = cmp (dist ↑z ↑(w.center r)) (w.im * Real.sinh r)

tactic: have hzw₀ : 0 < 2 * z.im * w.im := by positivity
state_before: case inr
z✝ w✝ : ℍ
r✝ R : ℝ
z w : ℍ
r : ℝ
this : MetricSpace ℍ := metricSpaceAux
hr₀ : 0 ≤ r
hr₀' : 0 ≤ w.im * Real.sinh r
⊢ cmp (dist z w) r = cmp (dist ↑z ↑(w.center r)) (w.im * Real.sinh r)
state_after: case inr
z✝ w✝ : ℍ
r✝ R : ℝ
z w : ℍ
r : ℝ
this : MetricSpace ℍ := metricSpaceAux
hr₀ : 0 ≤ r
hr₀' : 0 ≤ w.im * Real.sinh r
hzw₀ : 0 < 2 * z.im * w.im
⊢ cmp (dist z w) r = cmp (dist ↑z ↑(w.center r)) (w.im * Real.sinh r)

tactic: simp only [← cosh_strictMonoOn.cmp_map_eq dist_nonneg hr₀, ←
  (pow_left_strictMonoOn two_ne_zero).cmp_map_eq dist_nonneg hr₀', dist_coe_center_sq]
state_before: case inr
z✝ w✝ : ℍ
r✝ R : ℝ
z w : ℍ
r : ℝ
this : MetricSpace ℍ := metricSpaceAux
hr₀ : 0 ≤ r
hr₀' : 0 ≤ w.im * Real.sinh r
hzw₀ : 0 < 2 * z.im * w.im
⊢ cmp (dist z w) r = cmp (dist ↑z ↑(w.center r)) (w.im * Real.sinh r)
state_after: case inr
z✝ w✝ : ℍ
r✝ R : ℝ
z w : ℍ
r : ℝ
this : MetricSpace ℍ := metricSpaceAux
hr₀ : 0 ≤ r
hr₀' : 0 ≤ w.im * Real.sinh r
hzw₀ : 0 < 2 * z.im * w.im
⊢ cmp (Real.cosh (dist z w)) (Real.cosh r) =
    cmp (2 * z.im * w.im * (Real.cosh (dist z w) - Real.cosh r) + (w.im * Real.sinh r) ^ 2) ((w.im * Real.sinh r) ^ 2)

tactic: rw [← cmp_mul_pos_left hzw₀, ← cmp_sub_zero, ← mul_sub, ← cmp_add_right, zero_add]
state_before: case inr
z✝ w✝ : ℍ
r✝ R : ℝ
z w : ℍ
r : ℝ
this : MetricSpace ℍ := metricSpaceAux
hr₀ : 0 ≤ r
hr₀' : 0 ≤ w.im * Real.sinh r
hzw₀ : 0 < 2 * z.im * w.im
⊢ cmp (Real.cosh (dist z w)) (Real.cosh r) =
    cmp (2 * z.im * w.im * (Real.cosh (dist z w) - Real.cosh r) + (w.im * Real.sinh r) ^ 2) ((w.im * Real.sinh r) ^ 2)
state_after: no goals

tactic: trans Ordering.gt
state_before: case inl
z✝ w✝ : ℍ
r✝ R : ℝ
z w : ℍ
r : ℝ
this : MetricSpace ℍ := metricSpaceAux
hr₀ : r < 0
⊢ cmp (dist z w) r = cmp (dist ↑z ↑(w.center r)) (w.im * Real.sinh r)
state_after: z✝ w✝ : ℍ
r✝ R : ℝ
z w : ℍ
r : ℝ
this : MetricSpace ℍ := metricSpaceAux
hr₀ : r < 0
⊢ cmp (dist z w) r = Ordering.gt

z✝ w✝ : ℍ
r✝ R : ℝ
z w : ℍ
r : ℝ
this : MetricSpace ℍ := metricSpaceAux
hr₀ : r < 0
⊢ Ordering.gt = cmp (dist ↑z ↑(w.center r)) (w.im * Real.sinh r)

tactic: exacts [(hr₀.trans_le dist_nonneg).cmp_eq_gt,
  ((mul_neg_of_pos_of_neg w.im_pos (sinh_neg_iff.2 hr₀)).trans_le dist_nonneg).cmp_eq_gt.symm]
state_before: z✝ w✝ : ℍ
r✝ R : ℝ
z w : ℍ
r : ℝ
this : MetricSpace ℍ := metricSpaceAux
hr₀ : r < 0
⊢ cmp (dist z w) r = Ordering.gt

z✝ w✝ : ℍ
r✝ R : ℝ
z w : ℍ
r : ℝ
this : MetricSpace ℍ := metricSpaceAux
hr₀ : r < 0
⊢ Ordering.gt = cmp (dist ↑z ↑(w.center r)) (w.im * Real.sinh r)
state_after: no goals

tactic: positivity
state_before: z✝ w✝ : ℍ
r✝ R : ℝ
z w : ℍ
r : ℝ
this : MetricSpace ℍ := metricSpaceAux
hr₀ : 0 ≤ r
⊢ 0 ≤ w.im * Real.sinh r
state_after: no goals

tactic: positivity
state_before: z✝ w✝ : ℍ
r✝ R : ℝ
z w : ℍ
r : ℝ
this : MetricSpace ℍ := metricSpaceAux
hr₀ : 0 ≤ r
hr₀' : 0 ≤ w.im * Real.sinh r
⊢ 0 < 2 * z.im * w.im
state_after: no goals