Theorem: WithLp.prod_antilipschitzWith_equiv_aux
File: Mathlib/Analysis/NormedSpace/ProdLp.lean

tactic: intro x y
state_before: p : ℝ≥0∞
𝕜 : Type u_1
α : Type u_2
β : Type u_3
hp : Fact (1 ≤ p)
inst✝¹ : PseudoEMetricSpace α
inst✝ : PseudoEMetricSpace β
⊢ AntilipschitzWith (2 ^ (1 / p).toReal) ⇑(WithLp.equiv p (α × β))
state_after: p : ℝ≥0∞
𝕜 : Type u_1
α : 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)
state_before: p : ℝ≥0∞
𝕜 : Type u_1
α : 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)
state_after: case inl
𝕜 : Type u_1
α : 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_1
α : 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: simp [edist]
state_before: case inl
𝕜 : Type u_1
α : 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)
state_after: no goals

tactic: have pos : 0 < p.toReal := by positivity
state_before: case inr
p : ℝ≥0∞
𝕜 : Type u_1
α : 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)
state_after: case inr
p : ℝ≥0∞
𝕜 : Type u_1
α : 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
state_before: case inr
p : ℝ≥0∞
𝕜 : Type u_1
α : 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)
state_after: case inr
p : ℝ≥0∞
𝕜 : Type u_1
α : 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)
state_before: case inr
p : ℝ≥0∞
𝕜 : Type u_1
α : 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)
state_after: case inr
p : ℝ≥0∞
𝕜 : Type u_1
α : 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]
state_before: case inr
p : ℝ≥0∞
𝕜 : Type u_1
α : 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)
state_after: case inr
p : ℝ≥0∞
𝕜 : Type u_1
α : 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]
state_before: case inr
p : ℝ≥0∞
𝕜 : Type u_1
α : 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)
state_after: case inr
p : ℝ≥0∞
𝕜 : Type u_1
α : 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]
state_before: case inr
p : ℝ≥0∞
𝕜 : Type u_1
α : 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)
state_after: no goals

tactic: positivity
state_before: p : ℝ≥0∞
𝕜 : Type u_1
α : 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
state_after: no goals

tactic: positivity
state_before: p : ℝ≥0∞
𝕜 : Type u_1
α : 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
state_after: no goals

tactic: gcongr <;> simp [edist]
state_before: p : ℝ≥0∞
𝕜 : Type u_1
α : 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)
state_after: no goals

tactic: 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]
state_before: p : ℝ≥0∞
𝕜 : Type u_1
α : 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 ((WithLp.equiv p (α × β)) x) ((WithLp.equiv p (α × β)) y) ^ p.toReal +
        edist ((WithLp.equiv p (α × β)) x) ((WithLp.equiv p (α × β)) y) ^ p.toReal) ^
      (1 / p.toReal) =
    ↑(2 ^ (1 / p.toReal)) * edist ((WithLp.equiv p (α × β)) x) ((WithLp.equiv p (α × β)) y)
state_after: no goals