Skip to content

Commit c43cec3

Browse files
committed
chore: move results from unitary namespace to Unitary (#30697)
All results living in the `unitary` namespace is now in the `Unitary` namespace. And the results `unitary.spectrum.unitary_conjugate` and `unitary.spectrum.unitary_conjugate'` are renamed to `Unitary.spectrum_star_conjugate_left` and `Unitary.spectrum_star_conjugate_right` to match the renaming convention in #30692.
1 parent d3e9e72 commit c43cec3

File tree

16 files changed

+194
-79
lines changed

16 files changed

+194
-79
lines changed

Mathlib/Algebra/Star/Unitary.lean

Lines changed: 75 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def unitary (R : Type*) [Monoid R] [StarMul R] : Submonoid R where
4444

4545
variable {R : Type*}
4646

47-
namespace unitary
47+
namespace Unitary
4848

4949
section Monoid
5050

@@ -127,7 +127,7 @@ theorem toUnits_injective : Function.Injective (toUnits : unitary R → Rˣ) :=
127127

128128
theorem _root_.IsUnit.mem_unitary_iff_star_mul_self {u : R} (hu : IsUnit u) :
129129
u ∈ unitary R ↔ star u * u = 1 := by
130-
rw [unitary.mem_iff, and_iff_left_of_imp fun h_mul => ?_]
130+
rw [mem_iff, and_iff_left_of_imp fun h_mul => ?_]
131131
lift u to Rˣ using hu
132132
exact left_inv_eq_right_inv h_mul u.mul_inv ▸ u.mul_inv
133133

@@ -142,13 +142,13 @@ alias ⟨_, _root_.IsUnit.mem_unitary_of_mul_star_self⟩ := IsUnit.mem_unitary_
142142
for all `x` and `y` in `R`. -/
143143
protected theorem mul_left_inj {x y : R} (U : unitary R) :
144144
x * U = y * U ↔ x = y :=
145-
unitary.val_toUnits_apply U ▸ Units.mul_left_inj _
145+
val_toUnits_apply U ▸ Units.mul_left_inj _
146146

147147
/-- For unitary `U` in a star-monoid `R`, `U * x = U * y` if and only if `x = y`
148148
for all `x` and `y` in `R`. -/
149149
protected theorem mul_right_inj {x y : R} (U : unitary R) :
150150
U * x = U * y ↔ x = y :=
151-
unitary.val_toUnits_apply U ▸ Units.mul_right_inj _
151+
val_toUnits_apply U ▸ Units.mul_right_inj _
152152

153153
lemma mul_inv_mem_iff {G : Type*} [Group G] [StarMul G] (a b : G) :
154154
a * b⁻¹ ∈ unitary G ↔ star a * a = star b * b := by
@@ -161,7 +161,7 @@ lemma inv_mul_mem_iff {G : Type*} [Group G] [StarMul G] (a b : G) :
161161

162162
theorem _root_.Units.unitary_eq : unitary Rˣ = (unitary R).comap (Units.coeHom R) := by
163163
ext
164-
simp [unitary.mem_iff, Units.ext_iff]
164+
simp [mem_iff, Units.ext_iff]
165165

166166
/-- In a star monoid, the product `a * b⁻¹` of units is unitary if `star a * a = star b * b`. -/
167167
protected lemma _root_.Units.mul_inv_mem_unitary (a b : Rˣ) :
@@ -185,14 +185,14 @@ lemma _root_.isStarNormal_of_mem_unitary {u : R} (hu : u ∈ unitary R) : IsStar
185185

186186
end Monoid
187187

188-
end unitary
188+
end Unitary
189189

190190
section Group
191191

192192
variable {G : Type*} [Group G] [StarMul G]
193193

194-
theorem unitary.inv_mem {g : G} (hg : g ∈ unitary G) : g⁻¹ ∈ unitary G := by
195-
simp_rw [unitary.mem_iff, star_inv, ← mul_inv_rev, inv_eq_one] at *
194+
theorem Unitary.inv_mem {g : G} (hg : g ∈ unitary G) : g⁻¹ ∈ unitary G := by
195+
simp_rw [mem_iff, star_inv, ← mul_inv_rev, inv_eq_one] at *
196196
exact hg.symm
197197

198198
variable (G) in
@@ -203,7 +203,7 @@ This situation naturally arises when considering the unitary elements as a
203203
subgroup of the group of units of a star monoid. -/
204204
def unitarySubgroup : Subgroup G where
205205
toSubmonoid := unitary G
206-
inv_mem' := unitary.inv_mem
206+
inv_mem' := Unitary.inv_mem
207207

208208
@[simp]
209209
theorem unitarySubgroup_toSubmonoid : (unitarySubgroup G).toSubmonoid = unitary G := rfl
@@ -212,12 +212,12 @@ theorem unitarySubgroup_toSubmonoid : (unitarySubgroup G).toSubmonoid = unitary
212212
theorem mem_unitarySubgroup_iff {g : G} : g ∈ unitarySubgroup G ↔ g ∈ unitary G :=
213213
Iff.rfl
214214

215-
nonrec theorem unitary.inv_mem_iff {g : G} : g⁻¹ ∈ unitary G ↔ g ∈ unitary G :=
215+
nonrec theorem Unitary.inv_mem_iff {g : G} : g⁻¹ ∈ unitary G ↔ g ∈ unitary G :=
216216
inv_mem_iff (H := unitarySubgroup G)
217217

218218
end Group
219219

220-
namespace unitary
220+
namespace Unitary
221221

222222
section SMul
223223

@@ -276,7 +276,7 @@ variable {R S T : Type*} [Monoid R] [StarMul R] [Monoid S] [StarMul S] [Monoid T
276276

277277
lemma map_mem {F : Type*} [FunLike F R S] [StarHomClass F R S] [MonoidHomClass F R S]
278278
(f : F) {r : R} (hr : r ∈ unitary R) : f r ∈ unitary S := by
279-
rw [unitary.mem_iff] at hr
279+
rw [mem_iff] at hr
280280
simpa [map_star, map_mul] using And.intro congr(f $(hr.1)) congr(f $(hr.2))
281281

282282
/-- The star monoid homomorphism between unitary subgroups induced by a star monoid homomorphism of
@@ -404,25 +404,78 @@ universe u
404404

405405
variable {R A : Type*} [CommSemiring R] [Ring A] [Algebra R A] [StarMul A]
406406

407-
/-- Unitary conjugation preserves the spectrum, star on left. -/
407+
/-- Unitary conjugation preserves the spectrum, star on right. -/
408408
@[simp]
409-
lemma spectrum.unitary_conjugate {a : A} {u : unitary A} :
410-
spectrum R (u * a * (star u : A)) = spectrum R a :=
411-
spectrum.units_conjugate (u := unitary.toUnits u)
409+
lemma spectrum_star_right_conjugate {a : A} {U : unitary A} :
410+
spectrum R (U * a * (star U : A)) = spectrum R a :=
411+
spectrum.units_conjugate (u := toUnits U)
412412

413-
/-- Unitary conjugation preserves the spectrum, star on right. -/
413+
/-- Unitary conjugation preserves the spectrum, star on left. -/
414414
@[simp]
415-
lemma spectrum.unitary_conjugate' {a : A} {u : unitary A} :
416-
spectrum R ((star u : A) * a * u) = spectrum R a := by
417-
simpa using spectrum.unitary_conjugate (u := star u)
415+
lemma spectrum_star_left_conjugate {a : A} {U : unitary A} :
416+
spectrum R ((star U : A) * a * U) = spectrum R a := by
417+
simpa using spectrum_star_right_conjugate (U := star U)
418418

419419
end UnitaryConjugate
420420

421-
end unitary
421+
end Unitary
422422

423423
theorem IsStarProjection.two_mul_sub_one_mem_unitary {R : Type*} [Ring R] [StarRing R] {p : R}
424424
(hp : IsStarProjection p) : 2 * p - 1 ∈ unitary R := by
425-
simp only [two_mul, unitary.mem_iff, star_sub, star_add,
425+
simp only [two_mul, Unitary.mem_iff, star_sub, star_add,
426426
hp.isSelfAdjoint.star_eq, star_one, mul_sub, mul_add,
427427
sub_mul, add_mul, hp.isIdempotentElem.eq, one_mul, add_sub_cancel_right,
428428
mul_one, sub_sub_cancel, and_self]
429+
430+
namespace unitary
431+
432+
/-! ### Deprecated results -/
433+
434+
@[deprecated (since := "2025-10-29")] alias mem_iff := Unitary.mem_iff
435+
@[deprecated (since := "2025-10-29")] alias star_mul_self_of_mem := Unitary.star_mul_self_of_mem
436+
@[deprecated (since := "2025-10-29")] alias mul_star_self_of_mem := Unitary.mul_star_self_of_mem
437+
@[deprecated (since := "2025-10-29")] alias star_mem := Unitary.star_mem
438+
@[deprecated (since := "2025-10-29")] alias star_mem_iff := Unitary.star_mem_iff
439+
@[deprecated (since := "2025-10-29")] alias coe_star := Unitary.coe_star
440+
@[deprecated (since := "2025-10-29")] alias coe_star_mul_self := Unitary.coe_star_mul_self
441+
@[deprecated (since := "2025-10-29")] alias coe_mul_star_self := Unitary.coe_mul_star_self
442+
@[deprecated (since := "2025-10-29")] alias star_mul_self := Unitary.star_mul_self
443+
@[deprecated (since := "2025-10-29")] alias mul_star_self := Unitary.mul_star_self
444+
@[deprecated (since := "2025-10-29")] alias star_eq_inv := Unitary.star_eq_inv
445+
@[deprecated (since := "2025-10-29")] alias star_eq_inv' := Unitary.star_eq_inv'
446+
@[deprecated (since := "2025-10-29")] alias toUnits := Unitary.toUnits
447+
@[deprecated (since := "2025-10-29")] alias val_toUnits_apply := Unitary.val_toUnits_apply
448+
@[deprecated (since := "2025-10-29")] alias toUnits_injective := Unitary.toUnits_injective
449+
@[deprecated (since := "2025-10-29")] alias mul_left_inj := Unitary.mul_left_inj
450+
@[deprecated (since := "2025-10-29")] alias mul_right_inj := Unitary.mul_right_inj
451+
@[deprecated (since := "2025-10-29")] alias mul_inv_mem_iff := Unitary.mul_inv_mem_iff
452+
@[deprecated (since := "2025-10-29")] alias inv_mul_mem_iff := Unitary.inv_mul_mem_iff
453+
@[deprecated (since := "2025-10-29")] alias inv_mem := Unitary.inv_mem
454+
@[deprecated (since := "2025-10-29")] alias smul_mem_of_mem := Unitary.smul_mem_of_mem
455+
@[deprecated (since := "2025-10-29")] alias smul_mem := Unitary.smul_mem
456+
@[deprecated (since := "2025-10-29")] alias coe_smul := Unitary.coe_smul
457+
@[deprecated (since := "2025-10-29")] alias map_mem := Unitary.map_mem
458+
@[deprecated (since := "2025-10-29")] alias map := Unitary.map
459+
@[deprecated (since := "2025-10-29")] alias coe_map := Unitary.coe_map
460+
@[deprecated (since := "2025-10-29")] alias coe_map_star := Unitary.coe_map_star
461+
@[deprecated (since := "2025-10-29")] alias map_id := Unitary.map_id
462+
@[deprecated (since := "2025-10-29")] alias map_comp := Unitary.map_comp
463+
@[deprecated (since := "2025-10-29")] alias map_injective := Unitary.map_injective
464+
@[deprecated (since := "2025-10-29")] alias toUnits_comp_map := Unitary.toUnits_comp_map
465+
@[deprecated (since := "2025-10-29")] alias mapEquiv := Unitary.mapEquiv
466+
@[deprecated (since := "2025-10-29")] alias mapEquiv_refl := Unitary.mapEquiv_refl
467+
@[deprecated (since := "2025-10-29")] alias mapEquiv_symm := Unitary.mapEquiv_symm
468+
@[deprecated (since := "2025-10-29")] alias mapEquiv_trans := Unitary.mapEquiv_trans
469+
@[deprecated (since := "2025-10-29")] alias toMonoidHom_mapEquiv := Unitary.toMonoidHom_mapEquiv
470+
@[deprecated (since := "2025-10-29")] alias mem_iff_star_mul_self := Unitary.mem_iff_star_mul_self
471+
@[deprecated (since := "2025-10-29")] alias mem_iff_self_mul_star := Unitary.mem_iff_self_mul_star
472+
@[deprecated (since := "2025-10-29")] alias coe_inv := Unitary.coe_inv
473+
@[deprecated (since := "2025-10-29")] alias coe_div := Unitary.coe_div
474+
@[deprecated (since := "2025-10-29")] alias coe_zpow := Unitary.coe_zpow
475+
@[deprecated (since := "2025-10-29")] alias coe_neg := Unitary.coe_neg
476+
@[deprecated (since := "2025-10-20")] alias spectrum.unitary_conjugate :=
477+
Unitary.spectrum_star_right_conjugate
478+
@[deprecated (since := "2025-10-20")] alias spectrum.unitary_conjugate' :=
479+
Unitary.spectrum_star_left_conjugate
480+
481+
end unitary

Mathlib/Analysis/CStarAlgebra/Basic.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ instance (priority := 100) [Nontrivial E] : NormOneClass E :=
212212

213213
theorem norm_coe_unitary [Nontrivial E] (U : unitary E) : ‖(U : E)‖ = 1 := by
214214
rw [← sq_eq_sq₀ (norm_nonneg _) zero_le_one, one_pow 2, sq, ← CStarRing.norm_star_mul_self,
215-
unitary.coe_star_mul_self, CStarRing.norm_one]
215+
Unitary.coe_star_mul_self, CStarRing.norm_one]
216216

217217
@[simp]
218218
theorem norm_of_mem_unitary [Nontrivial E] {U : E} (hU : U ∈ unitary E) : ‖U‖ = 1 :=
@@ -226,7 +226,7 @@ theorem norm_coe_unitary_mul (U : unitary E) (A : E) : ‖(U : E) * A‖ = ‖A
226226
_ ≤ ‖(U : E)‖ * ‖A‖ := norm_mul_le _ _
227227
_ = ‖A‖ := by rw [norm_coe_unitary, one_mul]
228228
· calc
229-
_ = ‖(U : E)⋆ * U * A‖ := by rw [unitary.coe_star_mul_self U, one_mul]
229+
_ = ‖(U : E)⋆ * U * A‖ := by rw [Unitary.coe_star_mul_self U, one_mul]
230230
_ ≤ ‖(U : E)⋆‖ * ‖(U : E) * A‖ := by
231231
rw [mul_assoc]
232232
exact norm_mul_le _ _
@@ -244,7 +244,7 @@ theorem norm_mul_coe_unitary (A : E) (U : unitary E) : ‖A * U‖ = ‖A‖ :=
244244
calc
245245
_ = ‖((U : E)⋆ * A⋆)⋆‖ := by simp only [star_star, star_mul]
246246
_ = ‖(U : E)⋆ * A⋆‖ := by rw [norm_star]
247-
_ = ‖A⋆‖ := norm_mem_unitary_mul (star A) (unitary.star_mem U.prop)
247+
_ = ‖A⋆‖ := norm_mem_unitary_mul (star A) (Unitary.star_mem U.prop)
248248
_ = ‖A‖ := norm_star _
249249

250250
theorem norm_mul_mem_unitary (A : E) {U : E} (hU : U ∈ unitary E) : ‖A * U‖ = ‖A‖ :=

Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Unitary.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ lemma unitary_iff_isStarNormal_and_spectrum_subset_unitary {u : A} :
4343
refine and_congr_right fun hu ↦ ?_
4444
nth_rw 1 [← cfc_id ℂ u]
4545
rw [cfc_unitary_iff id u, Set.subset_def]
46-
simp only [id_eq, RCLike.star_def, SetLike.mem_coe, unitary.mem_iff_star_mul_self]
46+
simp only [id_eq, RCLike.star_def, SetLike.mem_coe, Unitary.mem_iff_star_mul_self]
4747

4848
lemma mem_unitary_of_spectrum_subset_unitary {u : A}
4949
[IsStarNormal u] (hu : spectrum ℂ u ⊆ unitary ℂ) : u ∈ unitary A :=

Mathlib/Analysis/CStarAlgebra/Matrix.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ theorem entry_norm_bound_of_unitary {U : Matrix n n 𝕜} (hU : U ∈ Matrix.uni
6868
rw [diag_eq_norm_sum.1]
6969
norm_cast
7070
-- Since U is unitary, the diagonal entries of U * Uᴴ are all 1
71-
have mul_eq_one : U * Uᴴ = 1 := unitary.mul_star_self_of_mem hU
71+
have mul_eq_one : U * Uᴴ = 1 := Unitary.mul_star_self_of_mem hU
7272
have diag_eq_one : RCLike.re ((U * Uᴴ) i i) = 1 := by
7373
simp only [mul_eq_one, Matrix.one_apply_eq, RCLike.one_re]
7474
-- Putting it all together

Mathlib/Analysis/CStarAlgebra/Spectrum.lean

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ we can still establish a form of spectral permanence.
3434
3535
## Main statements
3636
37-
+ `unitary.spectrum_subset_circle`: The spectrum of a unitary element is contained in the unit
37+
+ `Unitary.spectrum_subset_circle`: The spectrum of a unitary element is contained in the unit
3838
sphere in `ℂ`.
3939
+ `IsSelfAdjoint.spectralRadius_eq_nnnorm`: The spectral radius of a selfadjoint element is equal
4040
to its norm.
@@ -68,21 +68,24 @@ section UnitarySpectrum
6868
variable {𝕜 : Type*} [NormedField 𝕜] {E : Type*} [NormedRing E] [StarRing E] [CStarRing E]
6969
[NormedAlgebra 𝕜 E] [CompleteSpace E]
7070

71-
theorem unitary.spectrum_subset_circle (u : unitary E) :
71+
theorem Unitary.spectrum_subset_circle (u : unitary E) :
7272
spectrum 𝕜 (u : E) ⊆ Metric.sphere 0 1 := by
7373
nontriviality E
7474
refine fun k hk => mem_sphere_zero_iff_norm.mpr (le_antisymm ?_ ?_)
7575
· simpa only [CStarRing.norm_coe_unitary u] using norm_le_norm_of_mem hk
76-
· rw [← unitary.val_toUnits_apply u] at hk
76+
· rw [← Unitary.val_toUnits_apply u] at hk
7777
have hnk := ne_zero_of_mem_of_unit hk
78-
rw [← inv_inv (unitary.toUnits u), ← spectrum.map_inv, Set.mem_inv] at hk
79-
have : ‖k‖⁻¹ ≤ ‖(↑(unitary.toUnits u)⁻¹ : E)‖ := by
78+
rw [← inv_inv (Unitary.toUnits u), ← spectrum.map_inv, Set.mem_inv] at hk
79+
have : ‖k‖⁻¹ ≤ ‖(↑(Unitary.toUnits u)⁻¹ : E)‖ := by
8080
simpa only [norm_inv] using norm_le_norm_of_mem hk
8181
simpa using inv_le_of_inv_le₀ (norm_pos_iff.mpr hnk) this
8282

83+
@[deprecated (since := "2025-10-29")] alias unitary.spectrum_subset_circle :=
84+
Unitary.spectrum_subset_circle
85+
8386
theorem spectrum.subset_circle_of_unitary {u : E} (h : u ∈ unitary E) :
8487
spectrum 𝕜 u ⊆ Metric.sphere 0 1 :=
85-
unitary.spectrum_subset_circle ⟨u, h⟩
88+
Unitary.spectrum_subset_circle ⟨u, h⟩
8689

8790
theorem spectrum.norm_eq_one_of_unitary {u : E} (hu : u ∈ unitary E)
8891
⦃z : 𝕜⦄ (hz : z ∈ spectrum 𝕜 u) : ‖z‖ = 1 := by

0 commit comments

Comments
 (0)