Skip to content

Commit 447620b

Browse files
committed
perf(Analysis/RCLike/Basic): move a section (#38034)
These lemmas compile more quickly if `RCLike ℝ` is available, so move them lower in the file.
1 parent 0fe8cd6 commit 447620b

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

Mathlib/Analysis/RCLike/Basic.lean

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -662,24 +662,6 @@ variable (K) in
662662
lemma nnnorm_nsmul [NormedAddCommGroup E] [NormedSpace K E] (n : ℕ) (x : E) :
663663
‖n • x‖₊ = n • ‖x‖₊ := by simpa [Nat.cast_smul_eq_nsmul] using nnnorm_smul (n : K) x
664664

665-
section NormedField
666-
variable [NormedField E] [CharZero E] [NormedSpace K E]
667-
include K
668-
669-
variable (K) in
670-
lemma norm_nnqsmul (q : ℚ≥0) (x : E) : ‖q • x‖ = q • ‖x‖ := by
671-
simpa [NNRat.cast_smul_eq_nnqsmul] using norm_smul (q : K) x
672-
673-
variable (K) in
674-
lemma nnnorm_nnqsmul (q : ℚ≥0) (x : E) : ‖q • x‖₊ = q • ‖x‖₊ := by
675-
simpa [NNRat.cast_smul_eq_nnqsmul] using nnnorm_smul (q : K) x
676-
677-
@[bound]
678-
lemma norm_expect_le {ι : Type*} {s : Finset ι} {f : ι → E} : ‖𝔼 i ∈ s, f i‖ ≤ 𝔼 i ∈ s, ‖f i‖ :=
679-
Finset.le_expect_of_subadditive norm_zero norm_add_le fun _ _ ↦ by rw [norm_nnqsmul K]
680-
681-
end NormedField
682-
683665
theorem mul_self_norm (z : K) : ‖z‖ * ‖z‖ = normSq z := by rw [normSq_eq_def', sq]
684666

685667
attribute [rclike_simps] norm_zero norm_one norm_eq_zero abs_norm norm_inv norm_div
@@ -788,6 +770,24 @@ end Instances
788770

789771
namespace RCLike
790772

773+
section NormedField
774+
variable [NormedField E] [CharZero E] [NormedSpace K E]
775+
include K
776+
777+
variable (K) in
778+
lemma norm_nnqsmul (q : ℚ≥0) (x : E) : ‖q • x‖ = q • ‖x‖ := by
779+
simpa [NNRat.cast_smul_eq_nnqsmul] using norm_smul (q : K) x
780+
781+
variable (K) in
782+
lemma nnnorm_nnqsmul (q : ℚ≥0) (x : E) : ‖q • x‖₊ = q • ‖x‖₊ := by
783+
simpa [NNRat.cast_smul_eq_nnqsmul] using nnnorm_smul (q : K) x
784+
785+
@[bound]
786+
lemma norm_expect_le {ι : Type*} {s : Finset ι} {f : ι → E} : ‖𝔼 i ∈ s, f i‖ ≤ 𝔼 i ∈ s, ‖f i‖ :=
787+
Finset.le_expect_of_subadditive norm_zero norm_add_le fun _ _ ↦ by rw [norm_nnqsmul K]
788+
789+
end NormedField
790+
791791
section Order
792792

793793
open scoped ComplexOrder

0 commit comments

Comments
 (0)