#33554 chore(Analysis/Normed/Module/Normalize): allow for RCLike instead of just the reals
In plain words
Generalises NormedSpace.normalize (the unit vector , with ) from real normed spaces to normed spaces over any RCLike field : now normalize 𝕜 x , with the scalar field passed explicitly. The basic API follows. normalize_smul_of_pos/_of_neg now take a scalar with or in the ComplexOrder partial order (positive or negative real). normalize_smul (real scalar) is renamed normalize_real_smul. All Euclidean-geometry uses (angles, triangle inequality, signedDist) now write normalize ℝ.
Transcriptions are drafted with an LLM from the diff and are a reading aid, not a verified statement: the Lean code is the reference.
PR description
Only the last lemma normalize_smul needs ℝ, which we rename to normalize_real_smul.
This also makes 𝕜 explicit in half of the results.
Conversation on GitHub 3
PR summary 50b8949c2f
Import changes for modified files
No significant changes to the import graph
<details><summary>Import changes for all files</summary>
|Files|Import difference| |-|-|
</details>
<details><summary>
Declarations diff
</summary>
+ normalize
+ normalize_real_smul
- NormedSpace.normalize
<details>
<summary>You can run this locally as follows</summary>
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>
## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>
</details>
The doc-module for script/declarations_diff.sh contains some details about this script.
</details>
<details><summary>No changes to technical debt.</summary>
You can run this locally as
./scripts/technical-debt-metrics.sh pr_summary
- The
relativevalue is the weighted sum of the differences with weight given by the inverse of the current value of the statistic. - The
absolutevalue is therelativevalue divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).
</details>
@themathqueen if you look at the PR which introduced this #26308 we had the discussion there, and we eventually opted for ℝ-only.
I think this PR should be closed, or else modified to do something entirely different, like add an explanation of the choice to be ℝ-specific to the module documentation.
This pull request has conflicts, please merge master and resolve them.
Mathlib/Analysis/CStarAlgebra/Unitary/Span.lean +1 −1
lemma CStarAlgebra.norm_smul_two_inv_smul_add_four_unitary (x : A) (hx : x ≠ 0Mathlib/Analysis/Normed/Module/Normalize.lean +30 −21
Function that returns unit length vector that points in the same directionmaybe add another version for real spaces? to allow for better rewriting:
theorem normalize_real_smul' {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V]
(r : ℝ) (x : V) :
normalize ℝ (r • x) = (SignType.sign r : ℝ) • normalize ℝ x := byMathlib/Geometry/Euclidean/Angle/Unoriented/Basic.lean +2 −2
lemma eq_of_angle_eq_zero_of_norm_eq {x y : V} (hxy : angle x y = 0) (h : ‖xlemma angle_normalize_left (x y : V) :Mathlib/Geometry/Euclidean/Angle/Unoriented/TriangleInequality.lean +18 −19
lemma inner_ortho_nonneg {x y : V} (hx : ‖x‖ = 1) (hy : ‖y‖ = 1) : 0 ≤variable (hx : ‖x‖ = 1) (hy : ‖y‖ = 1) (hz : ‖z‖ = 1)lemma inner_normalized_ortho_sq_add_inner_sq_eq_one :lemma angle_le_angle_add_angle_of_norm_eq_one : angle x z ≤ angle x y + anglelemma angle_expression_of_angle_eq_angle_sum :public theorem angle_le_angle_add_angle (x y z : V) :public theorem angle_eq_angle_add_angle_iff {x y z : V} (hy : y ≠ 0) :Mathlib/Geometry/Euclidean/SignedDist.lean +16 −17
section signedDistIn the degenerate case `v = 0`, it returns `0`.variable (v w : V) (p q r : P)lemma signedDist_triangle_right : signedDist v p r - signedDist v q r = signedDilemma abs_signedDist_le_dist : |signedDist v p q| ≤ dist p q := bylemma abs_signedDist_eq_dist_iff_vsub_mem_span :lemma signedDist_eq_dist_iff_vsub_mem_span : signedDist v p q = dist p q ↔ q -