l3lab/ntp-mathlib huggingface dataset:
/-- The subgroup of `S`-units of `Kˣ`. -/
@[simps!]
def unit : Subgroup Kˣ :=
  (⨅ (v) (_ : v ∉ S), (v : HeightOneSpectrum R).valuation.valuationSubring.unitGroup).copy
      {x : Kˣ | ∀ (v) (_ : v ∉ S), (v : HeightOneSpectrum R).valuation (x : K) = 1} <|
    Set.ext fun _ => by
      -- Porting note: was
      -- simpa only [SetLike.mem_coe, Subgroup.mem_iInf, Valuation.mem_unitGroup_iff]
      

Proof state:
R : Type u
inst✝⁵ : CommRing R
inst✝⁴ : IsDomain R
inst✝³ : IsDedekindDomain R
S : Set (HeightOneSpectrum R)
K : Type v
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
x✝ : Kˣ
⊢ x✝ ∈ {x | ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑x = 1} ↔
    x✝ ∈ ↑(⨅ v, ⨅ (_ : v ∉ S), ValuationSubring.unitGroup (Valuation.valuationSubring (HeightOneSpectrum.valuation v)))

Next tactic:
simp only [mem_setOf, SetLike.mem_coe, Subgroup.mem_iInf, Valuation.mem_unitGroup_iff]
/-- The group of `S`-units is the group of units of the ring of `S`-integers. -/
@[simps apply_val_coe symm_apply_coe]
def unitEquivUnitsInteger : S.unit K ≃* (S.integer K)ˣ where
  toFun x :=
    ⟨⟨((x : Kˣ) : K), fun v hv => (x.property v hv).le⟩,
      ⟨((x⁻¹ : Kˣ) : K), fun v hv => (x⁻¹.property v hv).le⟩,
      Subtype.ext x.val.val_inv, Subtype.ext x.val.inv_val⟩
  invFun x :=
    ⟨Units.mk0 x fun hx => x.ne_zero (ZeroMemClass.coe_eq_zero.mp hx),
    fun v hv =>
      eq_one_of_one_le_mul_left (x.val.property v hv) (x.inv.property v hv) <|
        Eq.ge <| by
          -- Porting note: was
          -- rw [← map_mul]; convert v.valuation.map_one; exact subtype.mk_eq_mk.mp x.val_inv⟩
          

Proof state:
R : Type u
inst✝⁵ : CommRing R
inst✝⁴ : IsDomain R
inst✝³ : IsDedekindDomain R
S : Set (HeightOneSpectrum R)
K : Type v
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
x : (↥(integer S K))ˣ
v : HeightOneSpectrum R
hv : v ∉ S
⊢ (HeightOneSpectrum.valuation v) ↑(Units.mk0 ↑↑x (_ : ↑↑x = 0 → False)) * (HeightOneSpectrum.valuation v) ↑x.inv = 1

Next tactic:
rw [Units.val_mk0, ← map_mul, Subtype.mk_eq_mk.mp x.val_inv, v.valuation.map_one]
/-- The group of `S`-units is the group of units of the ring of `S`-integers. -/
@[simps apply_val_coe symm_apply_coe]
def unitEquivUnitsInteger : S.unit K ≃* (S.integer K)ˣ where
  toFun x :=
    ⟨⟨((x : Kˣ) : K), fun v hv => (x.property v hv).le⟩,
      ⟨((x⁻¹ : Kˣ) : K), fun v hv => (x⁻¹.property v hv).le⟩,
      Subtype.ext x.val.val_inv, Subtype.ext x.val.inv_val⟩
  invFun x :=
    ⟨Units.mk0 x fun hx => x.ne_zero (ZeroMemClass.coe_eq_zero.mp hx),
    fun v hv =>
      eq_one_of_one_le_mul_left (x.val.property v hv) (x.inv.property v hv) <|
        Eq.ge <| by
          -- Porting note: was
          -- rw [← map_mul]; convert v.valuation.map_one; exact subtype.mk_eq_mk.mp x.val_inv⟩
          rw [Units.val_mk0, ← map_mul, Subtype.mk_eq_mk.mp x.val_inv, v.valuation.map_one]⟩
  left_inv _ := by 

Proof state:
R : Type u
inst✝⁵ : CommRing R
inst✝⁴ : IsDomain R
inst✝³ : IsDedekindDomain R
S : Set (HeightOneSpectrum R)
K : Type v
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
x✝ : ↥(unit S K)
⊢ (fun x =>
        { val := Units.mk0 ↑↑x (_ : ↑↑x = 0 → False),
          property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑(Units.mk0 ↑↑x (_ : ↑↑x = 0 → False)) = 1) })
      ((fun x =>
          { val := { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) },
            inv := { val := ↑(↑x)⁻¹, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) },
            val_inv :=
              (_ :
                { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) } *
                    { val := ↑(↑x)⁻¹, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) } =
                  1),
            inv_val :=
              (_ :
                { val := ↑(↑x)⁻¹, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) } *
                    { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) } =
                  1) })
        x✝) =
    x✝

Next tactic:
ext
/-- The group of `S`-units is the group of units of the ring of `S`-integers. -/
@[simps apply_val_coe symm_apply_coe]
def unitEquivUnitsInteger : S.unit K ≃* (S.integer K)ˣ where
  toFun x :=
    ⟨⟨((x : Kˣ) : K), fun v hv => (x.property v hv).le⟩,
      ⟨((x⁻¹ : Kˣ) : K), fun v hv => (x⁻¹.property v hv).le⟩,
      Subtype.ext x.val.val_inv, Subtype.ext x.val.inv_val⟩
  invFun x :=
    ⟨Units.mk0 x fun hx => x.ne_zero (ZeroMemClass.coe_eq_zero.mp hx),
    fun v hv =>
      eq_one_of_one_le_mul_left (x.val.property v hv) (x.inv.property v hv) <|
        Eq.ge <| by
          -- Porting note: was
          -- rw [← map_mul]; convert v.valuation.map_one; exact subtype.mk_eq_mk.mp x.val_inv⟩
          rw [Units.val_mk0, ← map_mul, Subtype.mk_eq_mk.mp x.val_inv, v.valuation.map_one]⟩
  left_inv _ := by ext; 

Proof state:
case a.a
R : Type u
inst✝⁵ : CommRing R
inst✝⁴ : IsDomain R
inst✝³ : IsDedekindDomain R
S : Set (HeightOneSpectrum R)
K : Type v
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
x✝ : ↥(unit S K)
⊢ ↑↑((fun x =>
            { val := Units.mk0 ↑↑x (_ : ↑↑x = 0 → False),
              property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑(Units.mk0 ↑↑x (_ : ↑↑x = 0 → False)) = 1) })
          ((fun x =>
              { val := { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) },
                inv := { val := ↑(↑x)⁻¹, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) },
                val_inv :=
                  (_ :
                    { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) } *
                        { val := ↑(↑x)⁻¹, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) } =
                      1),
                inv_val :=
                  (_ :
                    { val := ↑(↑x)⁻¹, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) } *
                        { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) } =
                      1) })
            x✝)) =
    ↑↑x✝

Next tactic:
rfl
/-- The group of `S`-units is the group of units of the ring of `S`-integers. -/
@[simps apply_val_coe symm_apply_coe]
def unitEquivUnitsInteger : S.unit K ≃* (S.integer K)ˣ where
  toFun x :=
    ⟨⟨((x : Kˣ) : K), fun v hv => (x.property v hv).le⟩,
      ⟨((x⁻¹ : Kˣ) : K), fun v hv => (x⁻¹.property v hv).le⟩,
      Subtype.ext x.val.val_inv, Subtype.ext x.val.inv_val⟩
  invFun x :=
    ⟨Units.mk0 x fun hx => x.ne_zero (ZeroMemClass.coe_eq_zero.mp hx),
    fun v hv =>
      eq_one_of_one_le_mul_left (x.val.property v hv) (x.inv.property v hv) <|
        Eq.ge <| by
          -- Porting note: was
          -- rw [← map_mul]; convert v.valuation.map_one; exact subtype.mk_eq_mk.mp x.val_inv⟩
          rw [Units.val_mk0, ← map_mul, Subtype.mk_eq_mk.mp x.val_inv, v.valuation.map_one]⟩
  left_inv _ := by ext; rfl
  right_inv _ := by 

Proof state:
R : Type u
inst✝⁵ : CommRing R
inst✝⁴ : IsDomain R
inst✝³ : IsDedekindDomain R
S : Set (HeightOneSpectrum R)
K : Type v
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
x✝ : (↥(integer S K))ˣ
⊢ (fun x =>
        { val := { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) },
          inv := { val := ↑(↑x)⁻¹, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) },
          val_inv :=
            (_ :
              { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) } *
                  { val := ↑(↑x)⁻¹, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) } =
                1),
          inv_val :=
            (_ :
              { val := ↑(↑x)⁻¹, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) } *
                  { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) } =
                1) })
      ((fun x =>
          { val := Units.mk0 ↑↑x (_ : ↑↑x = 0 → False),
            property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑(Units.mk0 ↑↑x (_ : ↑↑x = 0 → False)) = 1) })
        x✝) =
    x✝

Next tactic:
ext
/-- The group of `S`-units is the group of units of the ring of `S`-integers. -/
@[simps apply_val_coe symm_apply_coe]
def unitEquivUnitsInteger : S.unit K ≃* (S.integer K)ˣ where
  toFun x :=
    ⟨⟨((x : Kˣ) : K), fun v hv => (x.property v hv).le⟩,
      ⟨((x⁻¹ : Kˣ) : K), fun v hv => (x⁻¹.property v hv).le⟩,
      Subtype.ext x.val.val_inv, Subtype.ext x.val.inv_val⟩
  invFun x :=
    ⟨Units.mk0 x fun hx => x.ne_zero (ZeroMemClass.coe_eq_zero.mp hx),
    fun v hv =>
      eq_one_of_one_le_mul_left (x.val.property v hv) (x.inv.property v hv) <|
        Eq.ge <| by
          -- Porting note: was
          -- rw [← map_mul]; convert v.valuation.map_one; exact subtype.mk_eq_mk.mp x.val_inv⟩
          rw [Units.val_mk0, ← map_mul, Subtype.mk_eq_mk.mp x.val_inv, v.valuation.map_one]⟩
  left_inv _ := by ext; rfl
  right_inv _ := by ext; 

Proof state:
case a.a
R : Type u
inst✝⁵ : CommRing R
inst✝⁴ : IsDomain R
inst✝³ : IsDedekindDomain R
S : Set (HeightOneSpectrum R)
K : Type v
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
x✝ : (↥(integer S K))ˣ
⊢ ↑↑((fun x =>
            { val := { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) },
              inv := { val := ↑(↑x)⁻¹, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) },
              val_inv :=
                (_ :
                  { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) } *
                      { val := ↑(↑x)⁻¹, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) } =
                    1),
              inv_val :=
                (_ :
                  { val := ↑(↑x)⁻¹, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) } *
                      { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) } =
                    1) })
          ((fun x =>
              { val := Units.mk0 ↑↑x (_ : ↑↑x = 0 → False),
                property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑(Units.mk0 ↑↑x (_ : ↑↑x = 0 → False)) = 1) })
            x✝)) =
    ↑↑x✝

Next tactic:
rfl
theorem edist_eq_iSup (f g : PiLp ∞ β) : edist f g = ⨆ i, edist (f i) (g i) := by
  

Proof state:
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝¹ : Fintype ι
inst✝ : (i : ι) → EDist (β i)
f g : PiLp ⊤ β
⊢ edist f g = ⨆ i, edist (f i) (g i)

Next tactic:
dsimp [edist]
theorem edist_eq_iSup (f g : PiLp ∞ β) : edist f g = ⨆ i, edist (f i) (g i) := by
  dsimp [edist]
  

Proof state:
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝¹ : Fintype ι
inst✝ : (i : ι) → EDist (β i)
f g : PiLp ⊤ β
⊢ (if ⊤ = 0 then ↑(Finset.card (Finite.toFinset (_ : Set.Finite {i | edist (f i) (g i) ≠ 0})))
    else if ⊤ = ⊤ then ⨆ i, edist (f i) (g i) else (∑ i : ι, edist (f i) (g i) ^ 0) ^ (1 / 0)) =
    ⨆ i, edist (f i) (g i)

Next tactic:
exact if_neg ENNReal.top_ne_zero
/-- This holds independent of `p` and does not require `[Fact (1 ≤ p)]`. We keep it separate
from `pi_Lp.pseudo_emetric_space` so it can be used also for `p < 1`. -/
protected theorem edist_self (f : PiLp p β) : edist f f = 0 := by
  

Proof state:
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝¹ : Fintype ι
inst✝ : (i : ι) → PseudoEMetricSpace (β i)
f : PiLp p β
⊢ edist f f = 0

Next tactic:
rcases p.trichotomy with (rfl | rfl | h)
/-- This holds independent of `p` and does not require `[Fact (1 ≤ p)]`. We keep it separate
from `pi_Lp.pseudo_emetric_space` so it can be used also for `p < 1`. -/
protected theorem edist_self (f : PiLp p β) : edist f f = 0 := by
  rcases p.trichotomy with (rfl | rfl | h)
  · 

Proof state:
case inl
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝¹ : Fintype ι
inst✝ : (i : ι) → PseudoEMetricSpace (β i)
f : PiLp 0 β
⊢ edist f f = 0

Next tactic:
simp [edist_eq_card]
/-- This holds independent of `p` and does not require `[Fact (1 ≤ p)]`. We keep it separate
from `pi_Lp.pseudo_emetric_space` so it can be used also for `p < 1`. -/
protected theorem edist_self (f : PiLp p β) : edist f f = 0 := by
  rcases p.trichotomy with (rfl | rfl | h)
  · simp [edist_eq_card]
  · 

Proof state:
case inr.inl
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝¹ : Fintype ι
inst✝ : (i : ι) → PseudoEMetricSpace (β i)
f : PiLp ⊤ β
⊢ edist f f = 0

Next tactic:
simp [edist_eq_iSup]
/-- This holds independent of `p` and does not require `[Fact (1 ≤ p)]`. We keep it separate
from `pi_Lp.pseudo_emetric_space` so it can be used also for `p < 1`. -/
protected theorem edist_self (f : PiLp p β) : edist f f = 0 := by
  rcases p.trichotomy with (rfl | rfl | h)
  · simp [edist_eq_card]
  · simp [edist_eq_iSup]
  · 

Proof state:
case inr.inr
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝¹ : Fintype ι
inst✝ : (i : ι) → PseudoEMetricSpace (β i)
f : PiLp p β
h : 0 < ENNReal.toReal p
⊢ edist f f = 0

Next tactic:
simp [edist_eq_sum h, ENNReal.zero_rpow_of_pos h, ENNReal.zero_rpow_of_pos (inv_pos.2 <| h)]
/-- This holds independent of `p` and does not require `[Fact (1 ≤ p)]`. We keep it separate
from `pi_Lp.pseudo_emetric_space` so it can be used also for `p < 1`. -/
protected theorem edist_comm (f g : PiLp p β) : edist f g = edist g f := by
  

Proof state:
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝¹ : Fintype ι
inst✝ : (i : ι) → PseudoEMetricSpace (β i)
f g : PiLp p β
⊢ edist f g = edist g f

Next tactic:
rcases p.trichotomy with (rfl | rfl | h)
/-- This holds independent of `p` and does not require `[Fact (1 ≤ p)]`. We keep it separate
from `pi_Lp.pseudo_emetric_space` so it can be used also for `p < 1`. -/
protected theorem edist_comm (f g : PiLp p β) : edist f g = edist g f := by
  rcases p.trichotomy with (rfl | rfl | h)
  · 

Proof state:
case inl
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝¹ : Fintype ι
inst✝ : (i : ι) → PseudoEMetricSpace (β i)
f g : PiLp 0 β
⊢ edist f g = edist g f

Next tactic:
simp only [edist_eq_card, edist_comm]
/-- This holds independent of `p` and does not require `[Fact (1 ≤ p)]`. We keep it separate
from `pi_Lp.pseudo_emetric_space` so it can be used also for `p < 1`. -/
protected theorem edist_comm (f g : PiLp p β) : edist f g = edist g f := by
  rcases p.trichotomy with (rfl | rfl | h)
  · simp only [edist_eq_card, edist_comm]
  · 

Proof state:
case inr.inl
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝¹ : Fintype ι
inst✝ : (i : ι) → PseudoEMetricSpace (β i)
f g : PiLp ⊤ β
⊢ edist f g = edist g f

Next tactic:
simp only [edist_eq_iSup, edist_comm]
/-- This holds independent of `p` and does not require `[Fact (1 ≤ p)]`. We keep it separate
from `pi_Lp.pseudo_emetric_space` so it can be used also for `p < 1`. -/
protected theorem edist_comm (f g : PiLp p β) : edist f g = edist g f := by
  rcases p.trichotomy with (rfl | rfl | h)
  · simp only [edist_eq_card, edist_comm]
  · simp only [edist_eq_iSup, edist_comm]
  · 

Proof state:
case inr.inr
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝¹ : Fintype ι
inst✝ : (i : ι) → PseudoEMetricSpace (β i)
f g : PiLp p β
h : 0 < ENNReal.toReal p
⊢ edist f g = edist g f

Next tactic:
simp only [edist_eq_sum h, edist_comm]
theorem dist_eq_iSup (f g : PiLp ∞ α) : dist f g = ⨆ i, dist (f i) (g i) := by
  

Proof state:
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝¹ : Fintype ι
inst✝ : (i : ι) → Dist (α i)
f g : PiLp ⊤ α
⊢ dist f g = ⨆ i, dist (f i) (g i)

Next tactic:
dsimp [dist]
theorem dist_eq_iSup (f g : PiLp ∞ α) : dist f g = ⨆ i, dist (f i) (g i) := by
  dsimp [dist]
  

Proof state:
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝¹ : Fintype ι
inst✝ : (i : ι) → Dist (α i)
f g : PiLp ⊤ α
⊢ (if ⊤ = 0 then ↑(Finset.card (Finite.toFinset (_ : Set.Finite {i | dist (f i) (g i) ≠ 0})))
    else if ⊤ = ⊤ then ⨆ i, dist (f i) (g i) else (∑ i : ι, dist (f i) (g i) ^ 0) ^ (1 / 0)) =
    ⨆ i, dist (f i) (g i)

Next tactic:
exact if_neg ENNReal.top_ne_zero
theorem norm_eq_ciSup (f : PiLp ∞ β) : ‖f‖ = ⨆ i, ‖f i‖ := by
  

Proof state:
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝¹ : Fintype ι
inst✝ : (i : ι) → Norm (β i)
f : PiLp ⊤ β
⊢ ‖f‖ = ⨆ i, ‖f i‖

Next tactic:
dsimp [Norm.norm]
theorem norm_eq_ciSup (f : PiLp ∞ β) : ‖f‖ = ⨆ i, ‖f i‖ := by
  dsimp [Norm.norm]
  

Proof state:
p : ℝ≥0∞
𝕜 : Type u_1
𝕜' : Type u_2
ι : Type u_3
α : ι → Type u_4
β : ι → Type u_5
inst✝¹ : Fintype ι
inst✝ : (i : ι) → Norm (β i)
f : PiLp ⊤ β
⊢ (if ⊤ = 0 then ↑(Finset.card (Finite.toFinset (_ : Set.Finite {i | ‖f i‖ ≠ 0})))
    else if ⊤ = ⊤ then ⨆ i, ‖f i‖ else (∑ i : ι, ‖f i‖ ^ 0) ^ (1 / 0)) =
    ⨆ i, ‖f i‖

Next tactic:
exact if_neg ENNReal.top_ne_zero
/-- Endowing the space `PiLp p β` with the `L^p` pseudoemetric structure. This definition is not
satisfactory, as it does not register the fact that the topology and the uniform structure coincide
with the product one. 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 by the
product one using this pseudoemetric space and `PseudoEMetricSpace.replaceUniformity`. -/
def pseudoEmetricAux : PseudoEMetricSpace (PiLp p β) where
  edist_self := PiLp.edist_self p
  edist_comm := PiLp.edist_comm p
  edist_triangle f g h := 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 ι
f g h : PiLp p β
⊢ edist f h ≤ edist f g + edist g h

Next tactic:
rcases p.dichotomy with (rfl | hp)
/-- Endowing the space `PiLp p β` with the `L^p` pseudoemetric structure. This definition is not
satisfactory, as it does not register the fact that the topology and the uniform structure coincide
with the product one. 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 by the
product one using this pseudoemetric space and `PseudoEMetricSpace.replaceUniformity`. -/
def pseudoEmetricAux : PseudoEMetricSpace (PiLp p β) where
  edist_self := PiLp.edist_self p
  edist_comm := PiLp.edist_comm p
  edist_triangle f g h := by
    rcases p.dichotomy with (rfl | hp)
    · 

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 ≤ ⊤)
f g h : PiLp ⊤ β
⊢ edist f h ≤ edist f g + edist g h

Next tactic:
simp only [edist_eq_iSup]
/-- Endowing the space `PiLp p β` with the `L^p` pseudoemetric structure. This definition is not
satisfactory, as it does not register the fact that the topology and the uniform structure coincide
with the product one. 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 by the
product one using this pseudoemetric space and `PseudoEMetricSpace.replaceUniformity`. -/
def pseudoEmetricAux : PseudoEMetricSpace (PiLp p β) where
  edist_self := PiLp.edist_self p
  edist_comm := PiLp.edist_comm p
  edist_triangle f g h := by
    rcases p.dichotomy with (rfl | hp)
    · simp only [edist_eq_iSup]
      

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 ≤ ⊤)
f g h : PiLp ⊤ β
⊢ ⨆ i, edist (f i) (h i) ≤ (⨆ i, edist (f i) (g i)) + ⨆ i, edist (g i) (h i)

Next tactic:
cases isEmpty_or_nonempty ι
/-- Endowing the space `PiLp p β` with the `L^p` pseudoemetric structure. This definition is not
satisfactory, as it does not register the fact that the topology and the uniform structure coincide
with the product one. 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 by the
product one using this pseudoemetric space and `PseudoEMetricSpace.replaceUniformity`. -/
def pseudoEmetricAux : PseudoEMetricSpace (PiLp p β) where
  edist_self := PiLp.edist_self p
  edist_comm := PiLp.edist_comm p
  edist_triangle f g h := by
    rcases p.dichotomy with (rfl | hp)
    · simp only [edist_eq_iSup]
      cases isEmpty_or_nonempty ι
      · 

Proof state:
case inl.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 ≤ ⊤)
f g h : PiLp ⊤ β
h✝ : IsEmpty ι
⊢ ⨆ i, edist (f i) (h i) ≤ (⨆ i, edist (f i) (g i)) + ⨆ i, edist (g i) (h i)

Next tactic:
simp only [ciSup_of_empty, ENNReal.bot_eq_zero, add_zero, nonpos_iff_eq_zero]
/-- Endowing the space `PiLp p β` with the `L^p` pseudoemetric structure. This definition is not
satisfactory, as it does not register the fact that the topology and the uniform structure coincide
with the product one. 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 by the
product one using this pseudoemetric space and `PseudoEMetricSpace.replaceUniformity`. -/
def pseudoEmetricAux : PseudoEMetricSpace (PiLp p β) where
  edist_self := PiLp.edist_self p
  edist_comm := PiLp.edist_comm p
  edist_triangle f g h := by
    rcases p.dichotomy with (rfl | hp)
    · simp only [edist_eq_iSup]
      cases isEmpty_or_nonempty ι
      · simp only [ciSup_of_empty, ENNReal.bot_eq_zero, add_zero, nonpos_iff_eq_zero]
      -- Porting note: `le_iSup` needed some help
      

Proof state:
case inl.inr
𝕜 : 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 ≤ ⊤)
f g h : PiLp ⊤ β
h✝ : Nonempty ι
⊢ ⨆ i, edist (f i) (h i) ≤ (⨆ i, edist (f i) (g i)) + ⨆ i, edist (g i) (h i)

Next tactic:
refine
        iSup_le fun i => (edist_triangle _ (g i) _).trans <| add_le_add
            (le_iSup (fun k => edist (f k) (g k)) i) (le_iSup (fun k => edist (g k) (h k)) i)