l3lab/ntp-mathlib huggingface dataset:
/-- Endowing the space `PiLp p α` with the `L^p` pseudometric structure. This definition is not
satisfactory, as it does not register the fact that the topology, the uniform structure, and the
bornology coincide with the product ones. Therefore, we do not register it as an instance. Using
this as a temporary pseudoemetric space instance, we will show that the uniform structure is equal
(but not defeq) to the product one, and then register an instance in which we replace the uniform
structure and the bornology by the product ones using this pseudometric space,
`PseudoMetricSpace.replaceUniformity`, and `PseudoMetricSpace.replaceBornology`.

See note [reducible non-instances] -/
@[reducible]
def pseudoMetricAux : PseudoMetricSpace (PiLp p α) :=
  PseudoEMetricSpace.toPseudoMetricSpaceOfDist dist
    (fun f g => by
      rcases p.dichotomy with (rfl | h)
      · exact iSup_edist_ne_top_aux f g
      · rw [edist_eq_sum (zero_lt_one.trans_le h)]
        exact
          ENNReal.rpow_ne_top_of_nonneg (one_div_nonneg.2 (zero_le_one.trans h))
            (ne_of_lt <|
              ENNReal.sum_lt_top fun i hi =>
                ENNReal.rpow_ne_top_of_nonneg (zero_le_one.trans h) (edist_ne_top _ _)))
    fun f g => by
    rcases p.dichotomy with (rfl | h)
    · rw [edist_eq_iSup, dist_eq_iSup]
      · cases isEmpty_or_nonempty ι
        · simp only [Real.ciSup_empty, ciSup_of_empty, ENNReal.bot_eq_zero, ENNReal.zero_toReal]
        · refine' le_antisymm (ciSup_le fun i => _) _
          · rw [← ENNReal.ofReal_le_iff_le_toReal (iSup_edist_ne_top_aux f g), ←
              PseudoMetricSpace.edist_dist]
            -- Porting note: `le_iSup` needed some help
            exact le_iSup (fun k => edist (f k) (g k)) i
          · refine' ENNReal.toReal_le_of_le_ofReal (Real.sSup_nonneg _ _) (iSup_le fun i => _)
            · rintro - ⟨i, rfl⟩
              exact dist_nonneg
            · change PseudoMetricSpace.edist _ _ ≤ _
              rw [PseudoMetricSpace.edist_dist]
              -- Porting note: `le_ciSup` needed some help
              exact ENNReal.ofReal_le_ofReal
                (le_ciSup (Fintype.bddAbove_range (fun k => dist (f k) (g k))) i)
    · have A : ∀ i, edist (f i) (g i) ^ p.toReal ≠ ⊤ := fun i =>
        ENNReal.rpow_ne_top_of_nonneg (zero_le_one.trans h) (edist_ne_top _ _)
      

Proof state:
case inr
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝³ : Fact (1 ≤ p)
inst✝² : (i : ι) → PseudoMetricSpace (α i)
inst✝¹ : (i : ι) → PseudoEMetricSpace (β i)
inst✝ : Fintype ι
f g : PiLp p α
h : 1 ≤ ENNReal.toReal p
A : ∀ (i : ι), edist (f i) (g i) ^ ENNReal.toReal p ≠ ⊤
⊢ dist f g = ENNReal.toReal (edist f g)

Next tactic:
simp only [edist_eq_sum (zero_lt_one.trans_le h), dist_edist, ENNReal.toReal_rpow,
        dist_eq_sum (zero_lt_one.trans_le h), ← ENNReal.toReal_sum fun i _ => A i]
theorem lipschitzWith_equiv_aux : LipschitzWith 1 (WithLp.equiv p (∀ i, β i)) := by
  

Proof state:
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝³ : Fact (1 ≤ p)
inst✝² : (i : ι) → PseudoMetricSpace (α i)
inst✝¹ : (i : ι) → PseudoEMetricSpace (β i)
inst✝ : Fintype ι
⊢ LipschitzWith 1 ⇑(WithLp.equiv p ((i : ι) → β i))

Next tactic:
intro x y
theorem lipschitzWith_equiv_aux : LipschitzWith 1 (WithLp.equiv p (∀ i, β i)) := by
  intro x y
  

Proof state:
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝³ : Fact (1 ≤ p)
inst✝² : (i : ι) → PseudoMetricSpace (α i)
inst✝¹ : (i : ι) → PseudoEMetricSpace (β i)
inst✝ : Fintype ι
x y : WithLp p ((i : ι) → β i)
⊢ edist ((WithLp.equiv p ((i : ι) → β i)) x) ((WithLp.equiv p ((i : ι) → β i)) y) ≤ ↑1 * edist x y

Next tactic:
rcases p.dichotomy with (rfl | h)
theorem lipschitzWith_equiv_aux : LipschitzWith 1 (WithLp.equiv p (∀ i, β i)) := by
  intro x y
  rcases p.dichotomy with (rfl | h)
  · 

Proof state:
case inl
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝³ : (i : ι) → PseudoMetricSpace (α i)
inst✝² : (i : ι) → PseudoEMetricSpace (β i)
inst✝¹ : Fintype ι
inst✝ : Fact (1 ≤ ⊤)
x y : WithLp ⊤ ((i : ι) → β i)
⊢ edist ((WithLp.equiv ⊤ ((i : ι) → β i)) x) ((WithLp.equiv ⊤ ((i : ι) → β i)) y) ≤ ↑1 * edist x y

Next tactic:
simpa only [ENNReal.coe_one, one_mul, edist_eq_iSup, edist, Finset.sup_le_iff, Finset.mem_univ,
      forall_true_left] using le_iSup fun i => edist (x i) (y i)
theorem lipschitzWith_equiv_aux : LipschitzWith 1 (WithLp.equiv p (∀ i, β i)) := by
  intro x y
  rcases p.dichotomy with (rfl | h)
  · simpa only [ENNReal.coe_one, one_mul, edist_eq_iSup, edist, Finset.sup_le_iff, Finset.mem_univ,
      forall_true_left] using le_iSup fun i => edist (x i) (y i)
  · 

Proof state:
case inr
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝³ : Fact (1 ≤ p)
inst✝² : (i : ι) → PseudoMetricSpace (α i)
inst✝¹ : (i : ι) → PseudoEMetricSpace (β i)
inst✝ : Fintype ι
x y : WithLp p ((i : ι) → β i)
h : 1 ≤ ENNReal.toReal p
⊢ edist ((WithLp.equiv p ((i : ι) → β i)) x) ((WithLp.equiv p ((i : ι) → β i)) y) ≤ ↑1 * edist x y

Next tactic:
have cancel : p.toReal * (1 / p.toReal) = 1 := mul_div_cancel' 1 (zero_lt_one.trans_le h).ne'
theorem lipschitzWith_equiv_aux : LipschitzWith 1 (WithLp.equiv p (∀ i, β i)) := by
  intro x y
  rcases p.dichotomy with (rfl | h)
  · simpa only [ENNReal.coe_one, one_mul, edist_eq_iSup, edist, Finset.sup_le_iff, Finset.mem_univ,
      forall_true_left] using le_iSup fun i => edist (x i) (y i)
  · have cancel : p.toReal * (1 / p.toReal) = 1 := mul_div_cancel' 1 (zero_lt_one.trans_le h).ne'
    

Proof state:
case inr
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝³ : Fact (1 ≤ p)
inst✝² : (i : ι) → PseudoMetricSpace (α i)
inst✝¹ : (i : ι) → PseudoEMetricSpace (β i)
inst✝ : Fintype ι
x y : WithLp p ((i : ι) → β i)
h : 1 ≤ ENNReal.toReal p
cancel : ENNReal.toReal p * (1 / ENNReal.toReal p) = 1
⊢ edist ((WithLp.equiv p ((i : ι) → β i)) x) ((WithLp.equiv p ((i : ι) → β i)) y) ≤ ↑1 * edist x y

Next tactic:
rw [edist_eq_sum (zero_lt_one.trans_le h)]
theorem lipschitzWith_equiv_aux : LipschitzWith 1 (WithLp.equiv p (∀ i, β i)) := by
  intro x y
  rcases p.dichotomy with (rfl | h)
  · simpa only [ENNReal.coe_one, one_mul, edist_eq_iSup, edist, Finset.sup_le_iff, Finset.mem_univ,
      forall_true_left] using le_iSup fun i => edist (x i) (y i)
  · have cancel : p.toReal * (1 / p.toReal) = 1 := mul_div_cancel' 1 (zero_lt_one.trans_le h).ne'
    rw [edist_eq_sum (zero_lt_one.trans_le h)]
    

Proof state:
case inr
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝³ : Fact (1 ≤ p)
inst✝² : (i : ι) → PseudoMetricSpace (α i)
inst✝¹ : (i : ι) → PseudoEMetricSpace (β i)
inst✝ : Fintype ι
x y : WithLp p ((i : ι) → β i)
h : 1 ≤ ENNReal.toReal p
cancel : ENNReal.toReal p * (1 / ENNReal.toReal p) = 1
⊢ edist ((WithLp.equiv p ((i : ι) → β i)) x) ((WithLp.equiv p ((i : ι) → β i)) y) ≤
    ↑1 * (∑ i : ι, edist (x i) (y i) ^ ENNReal.toReal p) ^ (1 / ENNReal.toReal p)

Next tactic:
simp only [edist, forall_prop_of_true, one_mul, Finset.mem_univ, Finset.sup_le_iff,
      ENNReal.coe_one]
theorem lipschitzWith_equiv_aux : LipschitzWith 1 (WithLp.equiv p (∀ i, β i)) := by
  intro x y
  rcases p.dichotomy with (rfl | h)
  · simpa only [ENNReal.coe_one, one_mul, edist_eq_iSup, edist, Finset.sup_le_iff, Finset.mem_univ,
      forall_true_left] using le_iSup fun i => edist (x i) (y i)
  · have cancel : p.toReal * (1 / p.toReal) = 1 := mul_div_cancel' 1 (zero_lt_one.trans_le h).ne'
    rw [edist_eq_sum (zero_lt_one.trans_le h)]
    simp only [edist, forall_prop_of_true, one_mul, Finset.mem_univ, Finset.sup_le_iff,
      ENNReal.coe_one]
    

Proof state:
case inr
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝³ : Fact (1 ≤ p)
inst✝² : (i : ι) → PseudoMetricSpace (α i)
inst✝¹ : (i : ι) → PseudoEMetricSpace (β i)
inst✝ : Fintype ι
x y : WithLp p ((i : ι) → β i)
h : 1 ≤ ENNReal.toReal p
cancel : ENNReal.toReal p * (1 / ENNReal.toReal p) = 1
⊢ ∀ (b : ι),
    edist ((WithLp.equiv p ((i : ι) → β i)) x b) ((WithLp.equiv p ((i : ι) → β i)) y b) ≤
      (∑ x_1 : ι, edist (x x_1) (y x_1) ^ ENNReal.toReal p) ^ (1 / ENNReal.toReal p)

Next tactic:
intro i
theorem lipschitzWith_equiv_aux : LipschitzWith 1 (WithLp.equiv p (∀ i, β i)) := by
  intro x y
  rcases p.dichotomy with (rfl | h)
  · simpa only [ENNReal.coe_one, one_mul, edist_eq_iSup, edist, Finset.sup_le_iff, Finset.mem_univ,
      forall_true_left] using le_iSup fun i => edist (x i) (y i)
  · have cancel : p.toReal * (1 / p.toReal) = 1 := mul_div_cancel' 1 (zero_lt_one.trans_le h).ne'
    rw [edist_eq_sum (zero_lt_one.trans_le h)]
    simp only [edist, forall_prop_of_true, one_mul, Finset.mem_univ, Finset.sup_le_iff,
      ENNReal.coe_one]
    intro i
    

Proof state:
case inr
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝³ : Fact (1 ≤ p)
inst✝² : (i : ι) → PseudoMetricSpace (α i)
inst✝¹ : (i : ι) → PseudoEMetricSpace (β i)
inst✝ : Fintype ι
x y : WithLp p ((i : ι) → β i)
h : 1 ≤ ENNReal.toReal p
cancel : ENNReal.toReal p * (1 / ENNReal.toReal p) = 1
i : ι
⊢ edist ((WithLp.equiv p ((i : ι) → β i)) x i) ((WithLp.equiv p ((i : ι) → β i)) y i) ≤
    (∑ x_1 : ι, edist (x x_1) (y x_1) ^ ENNReal.toReal p) ^ (1 / ENNReal.toReal p)

Next tactic:
calc
      edist (x i) (y i) = (edist (x i) (y i) ^ p.toReal) ^ (1 / p.toReal) := by
        simp [← ENNReal.rpow_mul, cancel, -one_div]
      _ ≤ (∑ i, edist (x i) (y i) ^ p.toReal) ^ (1 / p.toReal) := by
        gcongr
        exact Finset.single_le_sum (fun i _ => (bot_le : (0 : ℝ≥0∞) ≤ _)) (Finset.mem_univ i)
theorem lipschitzWith_equiv_aux : LipschitzWith 1 (WithLp.equiv p (∀ i, β i)) := by
  intro x y
  rcases p.dichotomy with (rfl | h)
  · simpa only [ENNReal.coe_one, one_mul, edist_eq_iSup, edist, Finset.sup_le_iff, Finset.mem_univ,
      forall_true_left] using le_iSup fun i => edist (x i) (y i)
  · have cancel : p.toReal * (1 / p.toReal) = 1 := mul_div_cancel' 1 (zero_lt_one.trans_le h).ne'
    rw [edist_eq_sum (zero_lt_one.trans_le h)]
    simp only [edist, forall_prop_of_true, one_mul, Finset.mem_univ, Finset.sup_le_iff,
      ENNReal.coe_one]
    intro i
    calc
      edist (x i) (y i) = (edist (x i) (y i) ^ p.toReal) ^ (1 / p.toReal) := by
        

Proof state:
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝³ : Fact (1 ≤ p)
inst✝² : (i : ι) → PseudoMetricSpace (α i)
inst✝¹ : (i : ι) → PseudoEMetricSpace (β i)
inst✝ : Fintype ι
x y : WithLp p ((i : ι) → β i)
h : 1 ≤ ENNReal.toReal p
cancel : ENNReal.toReal p * (1 / ENNReal.toReal p) = 1
i : ι
⊢ edist (x i) (y i) = (edist (x i) (y i) ^ ENNReal.toReal p) ^ (1 / ENNReal.toReal p)

Next tactic:
simp [← ENNReal.rpow_mul, cancel, -one_div]
theorem lipschitzWith_equiv_aux : LipschitzWith 1 (WithLp.equiv p (∀ i, β i)) := by
  intro x y
  rcases p.dichotomy with (rfl | h)
  · simpa only [ENNReal.coe_one, one_mul, edist_eq_iSup, edist, Finset.sup_le_iff, Finset.mem_univ,
      forall_true_left] using le_iSup fun i => edist (x i) (y i)
  · have cancel : p.toReal * (1 / p.toReal) = 1 := mul_div_cancel' 1 (zero_lt_one.trans_le h).ne'
    rw [edist_eq_sum (zero_lt_one.trans_le h)]
    simp only [edist, forall_prop_of_true, one_mul, Finset.mem_univ, Finset.sup_le_iff,
      ENNReal.coe_one]
    intro i
    calc
      edist (x i) (y i) = (edist (x i) (y i) ^ p.toReal) ^ (1 / p.toReal) := by
        simp [← ENNReal.rpow_mul, cancel, -one_div]
      _ ≤ (∑ i, edist (x i) (y i) ^ p.toReal) ^ (1 / p.toReal) := by
        

Proof state:
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝³ : Fact (1 ≤ p)
inst✝² : (i : ι) → PseudoMetricSpace (α i)
inst✝¹ : (i : ι) → PseudoEMetricSpace (β i)
inst✝ : Fintype ι
x y : WithLp p ((i : ι) → β i)
h : 1 ≤ ENNReal.toReal p
cancel : ENNReal.toReal p * (1 / ENNReal.toReal p) = 1
i : ι
⊢ (edist (x i) (y i) ^ ENNReal.toReal p) ^ (1 / ENNReal.toReal p) ≤
    (∑ i : ι, edist (x i) (y i) ^ ENNReal.toReal p) ^ (1 / ENNReal.toReal p)

Next tactic:
gcongr
theorem lipschitzWith_equiv_aux : LipschitzWith 1 (WithLp.equiv p (∀ i, β i)) := by
  intro x y
  rcases p.dichotomy with (rfl | h)
  · simpa only [ENNReal.coe_one, one_mul, edist_eq_iSup, edist, Finset.sup_le_iff, Finset.mem_univ,
      forall_true_left] using le_iSup fun i => edist (x i) (y i)
  · have cancel : p.toReal * (1 / p.toReal) = 1 := mul_div_cancel' 1 (zero_lt_one.trans_le h).ne'
    rw [edist_eq_sum (zero_lt_one.trans_le h)]
    simp only [edist, forall_prop_of_true, one_mul, Finset.mem_univ, Finset.sup_le_iff,
      ENNReal.coe_one]
    intro i
    calc
      edist (x i) (y i) = (edist (x i) (y i) ^ p.toReal) ^ (1 / p.toReal) := by
        simp [← ENNReal.rpow_mul, cancel, -one_div]
      _ ≤ (∑ i, edist (x i) (y i) ^ p.toReal) ^ (1 / p.toReal) := by
        gcongr
        

Proof state:
case h₁
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝³ : Fact (1 ≤ p)
inst✝² : (i : ι) → PseudoMetricSpace (α i)
inst✝¹ : (i : ι) → PseudoEMetricSpace (β i)
inst✝ : Fintype ι
x y : WithLp p ((i : ι) → β i)
h : 1 ≤ ENNReal.toReal p
cancel : ENNReal.toReal p * (1 / ENNReal.toReal p) = 1
i : ι
⊢ edist (x i) (y i) ^ ENNReal.toReal p ≤ ∑ i : ι, edist (x i) (y i) ^ ENNReal.toReal p

Next tactic:
exact Finset.single_le_sum (fun i _ => (bot_le : (0 : ℝ≥0∞) ≤ _)) (Finset.mem_univ i)
theorem antilipschitzWith_equiv_aux :
    AntilipschitzWith ((Fintype.card ι : ℝ≥0) ^ (1 / p).toReal) (WithLp.equiv p (∀ i, β i)) := by
  

Proof state:
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝³ : Fact (1 ≤ p)
inst✝² : (i : ι) → PseudoMetricSpace (α i)
inst✝¹ : (i : ι) → PseudoEMetricSpace (β i)
inst✝ : Fintype ι
⊢ AntilipschitzWith (↑(Fintype.card ι) ^ ENNReal.toReal (1 / p)) ⇑(WithLp.equiv p ((i : ι) → β i))

Next tactic:
intro x y
theorem antilipschitzWith_equiv_aux :
    AntilipschitzWith ((Fintype.card ι : ℝ≥0) ^ (1 / p).toReal) (WithLp.equiv p (∀ i, β i)) := by
  intro x y
  

Proof state:
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝³ : Fact (1 ≤ p)
inst✝² : (i : ι) → PseudoMetricSpace (α i)
inst✝¹ : (i : ι) → PseudoEMetricSpace (β i)
inst✝ : Fintype ι
x y : WithLp p ((i : ι) → β i)
⊢ edist x y ≤
    ↑(↑(Fintype.card ι) ^ ENNReal.toReal (1 / p)) *
      edist ((WithLp.equiv p ((i : ι) → β i)) x) ((WithLp.equiv p ((i : ι) → β i)) y)

Next tactic:
rcases p.dichotomy with (rfl | h)
theorem antilipschitzWith_equiv_aux :
    AntilipschitzWith ((Fintype.card ι : ℝ≥0) ^ (1 / p).toReal) (WithLp.equiv p (∀ i, β i)) := by
  intro x y
  rcases p.dichotomy with (rfl | h)
  · 

Proof state:
case inl
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝³ : (i : ι) → PseudoMetricSpace (α i)
inst✝² : (i : ι) → PseudoEMetricSpace (β i)
inst✝¹ : Fintype ι
inst✝ : Fact (1 ≤ ⊤)
x y : WithLp ⊤ ((i : ι) → β i)
⊢ edist x y ≤
    ↑(↑(Fintype.card ι) ^ ENNReal.toReal (1 / ⊤)) *
      edist ((WithLp.equiv ⊤ ((i : ι) → β i)) x) ((WithLp.equiv ⊤ ((i : ι) → β i)) y)

Next tactic:
simp only [edist_eq_iSup, ENNReal.div_top, ENNReal.zero_toReal, NNReal.rpow_zero,
      ENNReal.coe_one, one_mul, iSup_le_iff]
theorem antilipschitzWith_equiv_aux :
    AntilipschitzWith ((Fintype.card ι : ℝ≥0) ^ (1 / p).toReal) (WithLp.equiv p (∀ i, β i)) := by
  intro x y
  rcases p.dichotomy with (rfl | h)
  · simp only [edist_eq_iSup, ENNReal.div_top, ENNReal.zero_toReal, NNReal.rpow_zero,
      ENNReal.coe_one, one_mul, iSup_le_iff]
    -- Porting note: `Finset.le_sup` needed some help
    

Proof state:
case inl
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝³ : (i : ι) → PseudoMetricSpace (α i)
inst✝² : (i : ι) → PseudoEMetricSpace (β i)
inst✝¹ : Fintype ι
inst✝ : Fact (1 ≤ ⊤)
x y : WithLp ⊤ ((i : ι) → β i)
⊢ ∀ (i : ι), edist (x i) (y i) ≤ edist ((WithLp.equiv ⊤ ((i : ι) → β i)) x) ((WithLp.equiv ⊤ ((i : ι) → β i)) y)

Next tactic:
exact fun i => Finset.le_sup (f := fun i => edist (x i) (y i)) (Finset.mem_univ i)
theorem antilipschitzWith_equiv_aux :
    AntilipschitzWith ((Fintype.card ι : ℝ≥0) ^ (1 / p).toReal) (WithLp.equiv p (∀ i, β i)) := by
  intro x y
  rcases p.dichotomy with (rfl | h)
  · simp only [edist_eq_iSup, ENNReal.div_top, ENNReal.zero_toReal, NNReal.rpow_zero,
      ENNReal.coe_one, one_mul, iSup_le_iff]
    -- Porting note: `Finset.le_sup` needed some help
    exact fun i => Finset.le_sup (f := fun i => edist (x i) (y i)) (Finset.mem_univ i)
  · 

Proof state:
case inr
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝³ : Fact (1 ≤ p)
inst✝² : (i : ι) → PseudoMetricSpace (α i)
inst✝¹ : (i : ι) → PseudoEMetricSpace (β i)
inst✝ : Fintype ι
x y : WithLp p ((i : ι) → β i)
h : 1 ≤ ENNReal.toReal p
⊢ edist x y ≤
    ↑(↑(Fintype.card ι) ^ ENNReal.toReal (1 / p)) *
      edist ((WithLp.equiv p ((i : ι) → β i)) x) ((WithLp.equiv p ((i : ι) → β i)) y)

Next tactic:
have pos : 0 < p.toReal := zero_lt_one.trans_le h
theorem antilipschitzWith_equiv_aux :
    AntilipschitzWith ((Fintype.card ι : ℝ≥0) ^ (1 / p).toReal) (WithLp.equiv p (∀ i, β i)) := by
  intro x y
  rcases p.dichotomy with (rfl | h)
  · simp only [edist_eq_iSup, ENNReal.div_top, ENNReal.zero_toReal, NNReal.rpow_zero,
      ENNReal.coe_one, one_mul, iSup_le_iff]
    -- Porting note: `Finset.le_sup` needed some help
    exact fun i => Finset.le_sup (f := fun i => edist (x i) (y i)) (Finset.mem_univ i)
  · have pos : 0 < p.toReal := zero_lt_one.trans_le h
    

Proof state:
case inr
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝³ : Fact (1 ≤ p)
inst✝² : (i : ι) → PseudoMetricSpace (α i)
inst✝¹ : (i : ι) → PseudoEMetricSpace (β i)
inst✝ : Fintype ι
x y : WithLp p ((i : ι) → β i)
h : 1 ≤ ENNReal.toReal p
pos : 0 < ENNReal.toReal p
⊢ edist x y ≤
    ↑(↑(Fintype.card ι) ^ ENNReal.toReal (1 / p)) *
      edist ((WithLp.equiv p ((i : ι) → β i)) x) ((WithLp.equiv p ((i : ι) → β i)) y)

Next tactic:
have nonneg : 0 ≤ 1 / p.toReal := one_div_nonneg.2 (le_of_lt pos)
theorem antilipschitzWith_equiv_aux :
    AntilipschitzWith ((Fintype.card ι : ℝ≥0) ^ (1 / p).toReal) (WithLp.equiv p (∀ i, β i)) := by
  intro x y
  rcases p.dichotomy with (rfl | h)
  · simp only [edist_eq_iSup, ENNReal.div_top, ENNReal.zero_toReal, NNReal.rpow_zero,
      ENNReal.coe_one, one_mul, iSup_le_iff]
    -- Porting note: `Finset.le_sup` needed some help
    exact fun i => Finset.le_sup (f := fun i => edist (x i) (y i)) (Finset.mem_univ i)
  · have pos : 0 < p.toReal := zero_lt_one.trans_le h
    have nonneg : 0 ≤ 1 / p.toReal := one_div_nonneg.2 (le_of_lt pos)
    

Proof state:
case inr
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝³ : Fact (1 ≤ p)
inst✝² : (i : ι) → PseudoMetricSpace (α i)
inst✝¹ : (i : ι) → PseudoEMetricSpace (β i)
inst✝ : Fintype ι
x y : WithLp p ((i : ι) → β i)
h : 1 ≤ ENNReal.toReal p
pos : 0 < ENNReal.toReal p
nonneg : 0 ≤ 1 / ENNReal.toReal p
⊢ edist x y ≤
    ↑(↑(Fintype.card ι) ^ ENNReal.toReal (1 / p)) *
      edist ((WithLp.equiv p ((i : ι) → β i)) x) ((WithLp.equiv p ((i : ι) → β i)) y)

Next tactic:
have cancel : p.toReal * (1 / p.toReal) = 1 := mul_div_cancel' 1 (ne_of_gt pos)
theorem antilipschitzWith_equiv_aux :
    AntilipschitzWith ((Fintype.card ι : ℝ≥0) ^ (1 / p).toReal) (WithLp.equiv p (∀ i, β i)) := by
  intro x y
  rcases p.dichotomy with (rfl | h)
  · simp only [edist_eq_iSup, ENNReal.div_top, ENNReal.zero_toReal, NNReal.rpow_zero,
      ENNReal.coe_one, one_mul, iSup_le_iff]
    -- Porting note: `Finset.le_sup` needed some help
    exact fun i => Finset.le_sup (f := fun i => edist (x i) (y i)) (Finset.mem_univ i)
  · have pos : 0 < p.toReal := zero_lt_one.trans_le h
    have nonneg : 0 ≤ 1 / p.toReal := one_div_nonneg.2 (le_of_lt pos)
    have cancel : p.toReal * (1 / p.toReal) = 1 := mul_div_cancel' 1 (ne_of_gt pos)
    

Proof state:
case inr
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝³ : Fact (1 ≤ p)
inst✝² : (i : ι) → PseudoMetricSpace (α i)
inst✝¹ : (i : ι) → PseudoEMetricSpace (β i)
inst✝ : Fintype ι
x y : WithLp p ((i : ι) → β i)
h : 1 ≤ ENNReal.toReal p
pos : 0 < ENNReal.toReal p
nonneg : 0 ≤ 1 / ENNReal.toReal p
cancel : ENNReal.toReal p * (1 / ENNReal.toReal p) = 1
⊢ edist x y ≤
    ↑(↑(Fintype.card ι) ^ ENNReal.toReal (1 / p)) *
      edist ((WithLp.equiv p ((i : ι) → β i)) x) ((WithLp.equiv p ((i : ι) → β i)) y)

Next tactic:
rw [edist_eq_sum pos, ENNReal.toReal_div 1 p]
theorem antilipschitzWith_equiv_aux :
    AntilipschitzWith ((Fintype.card ι : ℝ≥0) ^ (1 / p).toReal) (WithLp.equiv p (∀ i, β i)) := by
  intro x y
  rcases p.dichotomy with (rfl | h)
  · simp only [edist_eq_iSup, ENNReal.div_top, ENNReal.zero_toReal, NNReal.rpow_zero,
      ENNReal.coe_one, one_mul, iSup_le_iff]
    -- Porting note: `Finset.le_sup` needed some help
    exact fun i => Finset.le_sup (f := fun i => edist (x i) (y i)) (Finset.mem_univ i)
  · have pos : 0 < p.toReal := zero_lt_one.trans_le h
    have nonneg : 0 ≤ 1 / p.toReal := one_div_nonneg.2 (le_of_lt pos)
    have cancel : p.toReal * (1 / p.toReal) = 1 := mul_div_cancel' 1 (ne_of_gt pos)
    rw [edist_eq_sum pos, ENNReal.toReal_div 1 p]
    

Proof state:
case inr
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝³ : Fact (1 ≤ p)
inst✝² : (i : ι) → PseudoMetricSpace (α i)
inst✝¹ : (i : ι) → PseudoEMetricSpace (β i)
inst✝ : Fintype ι
x y : WithLp p ((i : ι) → β i)
h : 1 ≤ ENNReal.toReal p
pos : 0 < ENNReal.toReal p
nonneg : 0 ≤ 1 / ENNReal.toReal p
cancel : ENNReal.toReal p * (1 / ENNReal.toReal p) = 1
⊢ (∑ i : ι, edist (x i) (y i) ^ ENNReal.toReal p) ^ (1 / ENNReal.toReal p) ≤
    ↑(↑(Fintype.card ι) ^ (ENNReal.toReal 1 / ENNReal.toReal p)) *
      edist ((WithLp.equiv p ((i : ι) → β i)) x) ((WithLp.equiv p ((i : ι) → β i)) y)

Next tactic:
simp only [edist, ← one_div, ENNReal.one_toReal]
theorem antilipschitzWith_equiv_aux :
    AntilipschitzWith ((Fintype.card ι : ℝ≥0) ^ (1 / p).toReal) (WithLp.equiv p (∀ i, β i)) := by
  intro x y
  rcases p.dichotomy with (rfl | h)
  · simp only [edist_eq_iSup, ENNReal.div_top, ENNReal.zero_toReal, NNReal.rpow_zero,
      ENNReal.coe_one, one_mul, iSup_le_iff]
    -- Porting note: `Finset.le_sup` needed some help
    exact fun i => Finset.le_sup (f := fun i => edist (x i) (y i)) (Finset.mem_univ i)
  · have pos : 0 < p.toReal := zero_lt_one.trans_le h
    have nonneg : 0 ≤ 1 / p.toReal := one_div_nonneg.2 (le_of_lt pos)
    have cancel : p.toReal * (1 / p.toReal) = 1 := mul_div_cancel' 1 (ne_of_gt pos)
    rw [edist_eq_sum pos, ENNReal.toReal_div 1 p]
    simp only [edist, ← one_div, ENNReal.one_toReal]
    

Proof state:
case inr
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝³ : Fact (1 ≤ p)
inst✝² : (i : ι) → PseudoMetricSpace (α i)
inst✝¹ : (i : ι) → PseudoEMetricSpace (β i)
inst✝ : Fintype ι
x y : WithLp p ((i : ι) → β i)
h : 1 ≤ ENNReal.toReal p
pos : 0 < ENNReal.toReal p
nonneg : 0 ≤ 1 / ENNReal.toReal p
cancel : ENNReal.toReal p * (1 / ENNReal.toReal p) = 1
⊢ (∑ x_1 : ι, edist (x x_1) (y x_1) ^ ENNReal.toReal p) ^ (1 / ENNReal.toReal p) ≤
    ↑(↑(Fintype.card ι) ^ (1 / ENNReal.toReal p)) *
      Finset.sup Finset.univ fun b =>
        edist ((WithLp.equiv p ((i : ι) → β i)) x b) ((WithLp.equiv p ((i : ι) → β i)) y b)

Next tactic:
calc
      (∑ i, edist (x i) (y i) ^ p.toReal) ^ (1 / p.toReal) ≤
          (∑ _i, edist (WithLp.equiv p _ x) (WithLp.equiv p _ y) ^ p.toReal) ^ (1 / p.toReal) := by
        gcongr with i
        exact Finset.le_sup (f := fun i => edist (x i) (y i)) (Finset.mem_univ i)
      _ =
          ((Fintype.card ι : ℝ≥0) ^ (1 / p.toReal) : ℝ≥0) *
            edist (WithLp.equiv p _ x) (WithLp.equiv p _ y) := by
        simp only [nsmul_eq_mul, Finset.card_univ, ENNReal.rpow_one, Finset.sum_const,
          ENNReal.mul_rpow_of_nonneg _ _ nonneg, ← ENNReal.rpow_mul, cancel]
        have : (Fintype.card ι : ℝ≥0∞) = (Fintype.card ι : ℝ≥0) :=
          (ENNReal.coe_nat (Fintype.card ι)).symm
        rw [this, ENNReal.coe_rpow_of_nonneg _ nonneg]