Skip to content

Commit e8a3084

Browse files
committed
chore(Algebra): rename theorems for consistency (#20271)
Taking chore material out of #16094 to make the diff cleaner. Moves: isSquare_one -> IsSquare.one isSquare_sq -> IsSquare.sq even_two_nsmul -> Even.two_nsmul isSumSq_sum_mul_self -> IsSumSq.mul_self
1 parent aa72692 commit e8a3084

5 files changed

Lines changed: 15 additions & 8 deletions

File tree

Mathlib/Algebra/Group/Even.lean

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ instance Multiplicative.instDecidablePredIsSquare [DecidablePred (Even : α →
8888
end Add
8989

9090
@[to_additive (attr := simp)]
91-
lemma isSquare_one [MulOneClass α] : IsSquare (1 : α) := ⟨1, (mul_one _).symm⟩
91+
lemma IsSquare.one [MulOneClass α] : IsSquare (1 : α) := ⟨1, (mul_one _).symm⟩
92+
93+
@[to_additive, deprecated (since := "2024-12-27")] alias isSquare_one := IsSquare.one
9294

9395
@[to_additive]
9496
lemma IsSquare.map [MulOneClass α] [MulOneClass β] [FunLike F α β] [MonoidHomClass F α β]
@@ -114,7 +116,10 @@ attribute [to_additive Even.exists_two_nsmul
114116
@[to_additive Even.nsmul'] lemma Even.isSquare_pow : Even n → ∀ a : α, IsSquare (a ^ n) := by
115117
rintro ⟨n, rfl⟩ a; exact ⟨a ^ n, pow_add _ _ _⟩
116118

117-
@[to_additive even_two_nsmul] lemma IsSquare_sq (a : α) : IsSquare (a ^ 2) := ⟨a, pow_two _⟩
119+
@[to_additive Even.two_nsmul] lemma IsSquare.sq (a : α) : IsSquare (a ^ 2) := ⟨a, pow_two _⟩
120+
121+
@[deprecated (since := "2024-12-27")] alias IsSquare_sq := IsSquare.sq
122+
@[deprecated (since := "2024-12-27")] alias even_two_nsmul := Even.two_nsmul
118123

119124
end Monoid
120125

Mathlib/Algebra/Ring/SumsOfSquares.lean

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,16 @@ theorem IsSumSq.add [AddMonoid R] {S1 S2 : R} (p1 : IsSumSq S1)
6161
@[deprecated (since := "2024-08-09")] alias isSumSq.add := IsSumSq.add
6262

6363
/-- A finite sum of squares is a sum of squares. -/
64-
theorem isSumSq_sum_mul_self {ι : Type*} [AddCommMonoid R] (s : Finset ι) (f : ι → R) :
64+
theorem IsSumSq.sum_mul_self {ι : Type*} [AddCommMonoid R] (s : Finset ι) (f : ι → R) :
6565
IsSumSq (∑ i ∈ s, f i * f i) := by
6666
induction s using Finset.cons_induction with
6767
| empty =>
6868
simpa only [Finset.sum_empty] using IsSumSq.zero
6969
| cons i s his h =>
7070
exact (Finset.sum_cons (β := R) his) ▸ IsSumSq.sq_add (f i) (∑ i ∈ s, f i * f i) h
7171

72+
@[deprecated (since := "2024-12-27")] alias isSumSq_sum_mul_self := IsSumSq.sum_mul_self
73+
7274
variable (R) in
7375
/--
7476
In an additive monoid with multiplication `R`, the type `sumSqIn R` is the submonoid of sums of

Mathlib/Data/Rat/Lemmas.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,11 @@ theorem isSquare_iff {q : ℚ} : IsSquare q ↔ IsSquare q.num ∧ IsSquare q.de
119119

120120
@[norm_cast, simp]
121121
theorem isSquare_natCast_iff {n : ℕ} : IsSquare (n : ℚ) ↔ IsSquare n := by
122-
simp_rw [isSquare_iff, num_natCast, den_natCast, isSquare_one, and_true, Int.isSquare_natCast_iff]
122+
simp_rw [isSquare_iff, num_natCast, den_natCast, IsSquare.one, and_true, Int.isSquare_natCast_iff]
123123

124124
@[norm_cast, simp]
125125
theorem isSquare_intCast_iff {z : ℤ} : IsSquare (z : ℚ) ↔ IsSquare z := by
126-
simp_rw [isSquare_iff, intCast_num, intCast_den, isSquare_one, and_true]
126+
simp_rw [isSquare_iff, intCast_num, intCast_den, IsSquare.one, and_true]
127127

128128
-- See note [no_index around OfNat.ofNat]
129129
@[simp]

Mathlib/LinearAlgebra/RootSystem/Finite/CanonicalBilinear.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ lemma corootForm_self_smul_root (i : ι) :
189189

190190
lemma rootForm_self_sum_of_squares (x : M) :
191191
IsSumSq (P.RootForm x x) :=
192-
P.rootForm_apply_apply x x ▸ isSumSq_sum_mul_self Finset.univ _
192+
P.rootForm_apply_apply x x ▸ IsSumSq.sum_mul_self Finset.univ _
193193

194194
lemma rootForm_root_self (j : ι) :
195195
P.RootForm (P.root j) (P.root j) = ∑ (i : ι), (P.pairing j i) * (P.pairing j i) := by

Mathlib/NumberTheory/LegendreSymbol/QuadraticChar/Basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ theorem quadraticCharFun_zero : quadraticCharFun F 0 = 0 := by
7373

7474
@[simp]
7575
theorem quadraticCharFun_one : quadraticCharFun F 1 = 1 := by
76-
simp only [quadraticCharFun, one_ne_zero, isSquare_one, if_true, if_false]
76+
simp only [quadraticCharFun, one_ne_zero, IsSquare.one, if_true, if_false]
7777

7878
/-- If `ringChar F = 2`, then `quadraticCharFun F` takes the value `1` on nonzero elements. -/
7979
theorem quadraticCharFun_eq_one_of_char_two (hF : ringChar F = 2) {a : F} (ha : a ≠ 0) :
@@ -140,7 +140,7 @@ theorem quadraticChar_one_iff_isSquare {a : F} (ha : a ≠ 0) :
140140

141141
/-- The quadratic character takes the value `1` on nonzero squares. -/
142142
theorem quadraticChar_sq_one' {a : F} (ha : a ≠ 0) : quadraticChar F (a ^ 2) = 1 := by
143-
simp only [quadraticChar_apply, quadraticCharFun, sq_eq_zero_iff, ha, IsSquare_sq, if_true,
143+
simp only [quadraticChar_apply, quadraticCharFun, sq_eq_zero_iff, ha, IsSquare.sq, if_true,
144144
if_false]
145145

146146
/-- The square of the quadratic character on nonzero arguments is `1`. -/

0 commit comments

Comments
 (0)