Skip to content

Commit f5e3cae

Browse files
committed
chore: define Complex.UnitDisc using Subsemigroup.unitBall (#39385)
The motivation is to have some local consistency between the definitions of `Circle` and `Complex.UnitDisc`. At the moment, there is a mild style inconsistency since `Circle` uses `Submonoid.unitSphere` whereas `Complex.UnitDisc` uses a raw `Metric.ball`. The background is that we are about to add `Complex.closedUnitDisc` and so the question arose about which pattern to follow. I decided that we should follow `Circle` and bring `Complex.UnitDisc` in line.
1 parent 6691654 commit f5e3cae

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

Mathlib/Analysis/Complex/UnitDisc/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace Complex
2727

2828
/-- The complex unit disc, denoted as `𝔻` within the Complex namespace -/
2929
def UnitDisc : Type :=
30-
ball (0 : ℂ) 1 deriving TopologicalSpace
30+
Subsemigroup.unitBall ℂ deriving TopologicalSpace
3131

3232
@[inherit_doc] scoped[Complex.UnitDisc] notation "𝔻" => Complex.UnitDisc
3333
open UnitDisc

Mathlib/Analysis/Normed/Field/UnitBall.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ def Subsemigroup.unitBall (𝕜 : Type*) [NonUnitalSeminormedRing 𝕜] : Subsem
3535
rw [mem_ball_zero_iff] at *
3636
exact (norm_mul_le _ _).trans_lt (mul_lt_one_of_nonneg_of_lt_one_left (norm_nonneg _) hx hy.le)
3737

38+
@[simp] lemma Subsemigroup.mem_unitBall (𝕜 : Type*) [NonUnitalSeminormedRing 𝕜] {x : 𝕜} :
39+
x ∈ Subsemigroup.unitBall 𝕜 ↔ ‖x‖ < 1 := by
40+
simp [Subsemigroup.unitBall]
41+
3842
instance Metric.unitBall.instSemigroup [NonUnitalSeminormedRing 𝕜] : Semigroup (ball (0 : 𝕜) 1) :=
3943
inferInstanceAs <| Semigroup (Subsemigroup.unitBall 𝕜)
4044

0 commit comments

Comments
 (0)