-- Mathlib/Analysis/Normed/Lp/ProdLp.lean
theorem prod_antilipschitzWith_equiv_aux [PseudoEMetricSpace α] [PseudoEMetricSpace β] :
    AntilipschitzWith ((2 : ℝ≥0) ^ (1 / p).toReal) (WithLp.equiv p (α × β))

Proof state:
case inl
α : Type u_2
β : Type u_3
inst✝¹ : PseudoEMetricSpace α
inst✝ : PseudoEMetricSpace β
hp : Fact (1 ≤ ⊤)
x y : WithLp ⊤ (α × β)
⊢ edist x y ≤ ↑(2 ^ (1 / ⊤).toReal) * edist ((WithLp.equiv ⊤ (α × β)) x) ((WithLp.equiv ⊤ (α × β)) y)

Tactic:
simp [edist]

Result:
no goals

Proof state:
case inr
p : ℝ≥0∞
α : Type u_2
β : Type u_3
hp : Fact (1 ≤ p)
inst✝¹ : PseudoEMetricSpace α
inst✝ : PseudoEMetricSpace β
x y : WithLp p (α × β)
h : 1 ≤ p.toReal
pos : 0 < p.toReal
nonneg : 0 ≤ 1 / p.toReal
cancel : p.toReal * (1 / p.toReal) = 1
⊢ (edist x.1 y.1 ^ p.toReal + edist x.2 y.2 ^ p.toReal) ^ (1 / p.toReal) ≤
    ↑(2 ^ (1 / p.toReal)) *
      (edist ((WithLp.equiv p (α × β)) x).1 ((WithLp.equiv p (α × β)) y).1 ⊔
        edist ((WithLp.equiv p (α × β)) x).2 ((WithLp.equiv p (α × β)) y).2)

Tactic:
calc
  (edist x.fst y.fst ^ p.toReal + edist x.snd y.snd ^ p.toReal) ^ (1 / p.toReal) ≤
      (edist (WithLp.equiv p _ x) (WithLp.equiv p _ y) ^ p.toReal +
      edist (WithLp.equiv p _ x) (WithLp.equiv p _ y) ^ p.toReal) ^ (1 / p.toReal) := by
    gcongr <;> simp [edist]
  _ = (2 ^ (1 / p.toReal) : ℝ≥0) * edist (WithLp.equiv p _ x) (WithLp.equiv p _ y) := by
    simp only [← two_mul, ENNReal.mul_rpow_of_nonneg _ _ nonneg, ← ENNReal.rpow_mul, cancel,
      ENNReal.rpow_one, ENNReal.coe_rpow_of_nonneg _ nonneg, coe_ofNat]

Result:
no goals

Proof state:
p : ℝ≥0∞
α : Type u_2
β : Type u_3
hp : Fact (1 ≤ p)
inst✝¹ : PseudoEMetricSpace α
inst✝ : PseudoEMetricSpace β
⊢ AntilipschitzWith (2 ^ (1 / p).toReal) ⇑(WithLp.equiv p (α × β))

Tactic:
intro x y

Result:
p : ℝ≥0∞
α : Type u_2
β : Type u_3
hp : Fact (1 ≤ p)
inst✝¹ : PseudoEMetricSpace α
inst✝ : PseudoEMetricSpace β
x y : WithLp p (α × β)
⊢ edist x y ≤ ↑(2 ^ (1 / p).toReal) * edist ((WithLp.equiv p (α × β)) x) ((WithLp.equiv p (α × β)) y)

Proof state:
p : ℝ≥0∞
α : Type u_2
β : Type u_3
hp : Fact (1 ≤ p)
inst✝¹ : PseudoEMetricSpace α
inst✝ : PseudoEMetricSpace β
x y : WithLp p (α × β)
h : 1 ≤ p.toReal
pos : 0 < p.toReal
nonneg : 0 ≤ 1 / p.toReal
cancel : p.toReal * (1 / p.toReal) = 1
⊢ (edist x.1 y.1 ^ p.toReal + edist x.2 y.2 ^ p.toReal) ^ (1 / p.toReal) ≤
    (edist ((WithLp.equiv p (α × β)) x) ((WithLp.equiv p (α × β)) y) ^ p.toReal +
        edist ((WithLp.equiv p (α × β)) x) ((WithLp.equiv p (α × β)) y) ^ p.toReal) ^
      (1 / p.toReal)

Tactic:
gcongr <;> simp [edist]

Result:
no goals

Proof state:
p : ℝ≥0∞
α : Type u_2
β : Type u_3
hp : Fact (1 ≤ p)
inst✝¹ : PseudoEMetricSpace α
inst✝ : PseudoEMetricSpace β
x y : WithLp p (α × β)
⊢ edist x y ≤ ↑(2 ^ (1 / p).toReal) * edist ((WithLp.equiv p (α × β)) x) ((WithLp.equiv p (α × β)) y)

Tactic:
rcases p.dichotomy with (rfl | h)

Result:
case inl
α : Type u_2
β : Type u_3
inst✝¹ : PseudoEMetricSpace α
inst✝ : PseudoEMetricSpace β
hp : Fact (1 ≤ ⊤)
x y : WithLp ⊤ (α × β)
⊢ edist x y ≤ ↑(2 ^ (1 / ⊤).toReal) * edist ((WithLp.equiv ⊤ (α × β)) x) ((WithLp.equiv ⊤ (α × β)) y)

case inr
p : ℝ≥0∞
α : Type u_2
β : Type u_3
hp : Fact (1 ≤ p)
inst✝¹ : PseudoEMetricSpace α
inst✝ : PseudoEMetricSpace β
x y : WithLp p (α × β)
h : 1 ≤ p.toReal
⊢ edist x y ≤ ↑(2 ^ (1 / p).toReal) * edist ((WithLp.equiv p (α × β)) x) ((WithLp.equiv p (α × β)) y)

Proof state:
case inr
p : ℝ≥0∞
α : Type u_2
β : Type u_3
hp : Fact (1 ≤ p)
inst✝¹ : PseudoEMetricSpace α
inst✝ : PseudoEMetricSpace β
x y : WithLp p (α × β)
h : 1 ≤ p.toReal
pos : 0 < p.toReal
⊢ edist x y ≤ ↑(2 ^ (1 / p).toReal) * edist ((WithLp.equiv p (α × β)) x) ((WithLp.equiv p (α × β)) y)

Tactic:
have nonneg : 0 ≤ 1 / p.toReal := by positivity

Result:
case inr
p : ℝ≥0∞
α : Type u_2
β : Type u_3
hp : Fact (1 ≤ p)
inst✝¹ : PseudoEMetricSpace α
inst✝ : PseudoEMetricSpace β
x y : WithLp p (α × β)
h : 1 ≤ p.toReal
pos : 0 < p.toReal
nonneg : 0 ≤ 1 / p.toReal
⊢ edist x y ≤ ↑(2 ^ (1 / p).toReal) * edist ((WithLp.equiv p (α × β)) x) ((WithLp.equiv p (α × β)) y)

Proof state:
case inr
p : ℝ≥0∞
α : Type u_2
β : Type u_3
hp : Fact (1 ≤ p)
inst✝¹ : PseudoEMetricSpace α
inst✝ : PseudoEMetricSpace β
x y : WithLp p (α × β)
h : 1 ≤ p.toReal
⊢ edist x y ≤ ↑(2 ^ (1 / p).toReal) * edist ((WithLp.equiv p (α × β)) x) ((WithLp.equiv p (α × β)) y)

Tactic:
have pos : 0 < p.toReal := by positivity

Result:
case inr
p : ℝ≥0∞
α : Type u_2
β : Type u_3
hp : Fact (1 ≤ p)
inst✝¹ : PseudoEMetricSpace α
inst✝ : PseudoEMetricSpace β
x y : WithLp p (α × β)
h : 1 ≤ p.toReal
pos : 0 < p.toReal
⊢ edist x y ≤ ↑(2 ^ (1 / p).toReal) * edist ((WithLp.equiv p (α × β)) x) ((WithLp.equiv p (α × β)) y)

Proof state:
p : ℝ≥0∞
α : Type u_2
β : Type u_3
hp : Fact (1 ≤ p)
inst✝¹ : PseudoEMetricSpace α
inst✝ : PseudoEMetricSpace β
x y : WithLp p (α × β)
h : 1 ≤ p.toReal
pos : 0 < p.toReal
⊢ 0 ≤ 1 / p.toReal

Tactic:
positivity

Result:
no goals

Proof state:
case inr
p : ℝ≥0∞
α : Type u_2
β : Type u_3
hp : Fact (1 ≤ p)
inst✝¹ : PseudoEMetricSpace α
inst✝ : PseudoEMetricSpace β
x y : WithLp p (α × β)
h : 1 ≤ p.toReal
pos : 0 < p.toReal
nonneg : 0 ≤ 1 / p.toReal
cancel : p.toReal * (1 / p.toReal) = 1
⊢ (edist x.1 y.1 ^ p.toReal + edist x.2 y.2 ^ p.toReal) ^ (1 / p.toReal) ≤
    ↑(2 ^ (ENNReal.toReal 1 / p.toReal)) * edist ((WithLp.equiv p (α × β)) x) ((WithLp.equiv p (α × β)) y)

Tactic:
simp only [edist, ← one_div, ENNReal.one_toReal]

Result:
case inr
p : ℝ≥0∞
α : Type u_2
β : Type u_3
hp : Fact (1 ≤ p)
inst✝¹ : PseudoEMetricSpace α
inst✝ : PseudoEMetricSpace β
x y : WithLp p (α × β)
h : 1 ≤ p.toReal
pos : 0 < p.toReal
nonneg : 0 ≤ 1 / p.toReal
cancel : p.toReal * (1 / p.toReal) = 1
⊢ (edist x.1 y.1 ^ p.toReal + edist x.2 y.2 ^ p.toReal) ^ (1 / p.toReal) ≤
    ↑(2 ^ (1 / p.toReal)) *
      (edist ((WithLp.equiv p (α × β)) x).1 ((WithLp.equiv p (α × β)) y).1 ⊔
        edist ((WithLp.equiv p (α × β)) x).2 ((WithLp.equiv p (α × β)) y).2)

Proof state:
p : ℝ≥0∞
α : Type u_2
β : Type u_3
hp : Fact (1 ≤ p)
inst✝¹ : PseudoEMetricSpace α
inst✝ : PseudoEMetricSpace β
x y : WithLp p (α × β)
h : 1 ≤ p.toReal
⊢ 0 < p.toReal

Tactic:
positivity

Result:
no goals

Proof state:
case inr
p : ℝ≥0∞
α : Type u_2
β : Type u_3
hp : Fact (1 ≤ p)
inst✝¹ : PseudoEMetricSpace α
inst✝ : PseudoEMetricSpace β
x y : WithLp p (α × β)
h : 1 ≤ p.toReal
pos : 0 < p.toReal
nonneg : 0 ≤ 1 / p.toReal
⊢ edist x y ≤ ↑(2 ^ (1 / p).toReal) * edist ((WithLp.equiv p (α × β)) x) ((WithLp.equiv p (α × β)) y)

Tactic:
have cancel : p.toReal * (1 / p.toReal) = 1 := mul_div_cancel₀ 1 (ne_of_gt pos)

Result:
case inr
p : ℝ≥0∞
α : Type u_2
β : Type u_3
hp : Fact (1 ≤ p)
inst✝¹ : PseudoEMetricSpace α
inst✝ : PseudoEMetricSpace β
x y : WithLp p (α × β)
h : 1 ≤ p.toReal
pos : 0 < p.toReal
nonneg : 0 ≤ 1 / p.toReal
cancel : p.toReal * (1 / p.toReal) = 1
⊢ edist x y ≤ ↑(2 ^ (1 / p).toReal) * edist ((WithLp.equiv p (α × β)) x) ((WithLp.equiv p (α × β)) y)

Proof state:
case inr
p : ℝ≥0∞
α : Type u_2
β : Type u_3
hp : Fact (1 ≤ p)
inst✝¹ : PseudoEMetricSpace α
inst✝ : PseudoEMetricSpace β
x y : WithLp p (α × β)
h : 1 ≤ p.toReal
pos : 0 < p.toReal
nonneg : 0 ≤ 1 / p.toReal
cancel : p.toReal * (1 / p.toReal) = 1
⊢ edist x y ≤ ↑(2 ^ (1 / p).toReal) * edist ((WithLp.equiv p (α × β)) x) ((WithLp.equiv p (α × β)) y)

Tactic:
rw [prod_edist_eq_add pos, ENNReal.toReal_div 1 p]

Result:
case inr
p : ℝ≥0∞
α : Type u_2
β : Type u_3
hp : Fact (1 ≤ p)
inst✝¹ : PseudoEMetricSpace α
inst✝ : PseudoEMetricSpace β
x y : WithLp p (α × β)
h : 1 ≤ p.toReal
pos : 0 < p.toReal
nonneg : 0 ≤ 1 / p.toReal
cancel : p.toReal * (1 / p.toReal) = 1
⊢ (edist x.1 y.1 ^ p.toReal + edist x.2 y.2 ^ p.toReal) ^ (1 / p.toReal) ≤
    ↑(2 ^ (ENNReal.toReal 1 / p.toReal)) * edist ((WithLp.equiv p (α × β)) x) ((WithLp.equiv p (α × β)) y)