Skip to content

Commit b031c0c

Browse files
committed
chore: export algebraMap from Algebra instead of having a def (leanprover-community#38430)
Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr>
1 parent 1887194 commit b031c0c

10 files changed

Lines changed: 16 additions & 23 deletions

File tree

Mathlib/Algebra/Algebra/Defs.lean

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,24 +88,17 @@ assert_not_exists Field Finset Module.End
8888

8989
universe u v w u₁ v₁
9090

91-
section Prio
92-
9391
/-- An associative unital `R`-algebra is a semiring `A` equipped with a map into its center `R → A`.
9492
9593
See the implementation notes in this file for discussion of the details of this definition.
9694
-/
9795
class Algebra (R : Type u) (A : Type v) [CommSemiring R] [Semiring A] extends SMul R A where
98-
/-- Embedding `R →+* A` given by `Algebra` structure.
99-
Use `algebraMap` from the root namespace instead. -/
100-
protected algebraMap : R →+* A
96+
/-- Embedding `R →+* A` given by `Algebra` structure. -/
97+
algebraMap (R) (A) : R →+* A
10198
commutes' : ∀ r x, algebraMap r * x = x * algebraMap r
10299
smul_def' : ∀ r x, r • x = algebraMap r * x
103100

104-
end Prio
105-
106-
/-- Embedding `R →+* A` given by `Algebra` structure. -/
107-
def algebraMap (R : Type u) (A : Type v) [CommSemiring R] [Semiring A] [Algebra R A] : R →+* A :=
108-
Algebra.algebraMap
101+
export Algebra (algebraMap)
109102

110103
theorem Algebra.subsingleton (R : Type u) (A : Type v) [CommSemiring R] [Semiring A] [Algebra R A]
111104
[Subsingleton R] : Subsingleton A :=

Mathlib/Algebra/Algebra/Pi.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,8 @@ end
250250
end AlgEquiv
251251

252252
/-- Apply an algebra map component-wise along a vector. -/
253-
def Pi.algebraMap (ι R A : Type*) [CommSemiring R] [Semiring A] [Algebra R A] :
253+
protected def Pi.algebraMap (ι R A : Type*) [CommSemiring R] [Semiring A] [Algebra R A] :
254254
(ι → R) →ₗ[R] (ι → A) where
255-
toFun v := _root_.algebraMap R A ∘ v
255+
toFun v := algebraMap R A ∘ v
256256
map_add' v w := by simp
257257
map_smul' t v := by ext; simp [Algebra.smul_def]

Mathlib/Algebra/Star/Subalgebra.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ theorem _root_.Subalgebra.starClosure_eq_adjoin (S : Subalgebra R A) :
513513
@[elab_as_elim]
514514
theorem adjoin_induction {s : Set A} {p : (x : A) → x ∈ adjoin R s → Prop}
515515
(mem : ∀ (x) (h : x ∈ s), p x (subset_adjoin R s h))
516-
(algebraMap : ∀ r, p (_root_.algebraMap R _ r) (_root_.algebraMap_mem _ r))
516+
(algebraMap : ∀ r, p (algebraMap R _ r) (algebraMap_mem _ r))
517517
(add : ∀ x y hx hy, p x hx → p y hy → p (x + y) (add_mem hx hy))
518518
(mul : ∀ x y hx hy, p x hx → p y hy → p (x * y) (mul_mem hx hy))
519519
(star : ∀ x hx, p x hx → p (star x) (star_mem hx))
@@ -529,11 +529,11 @@ theorem adjoin_induction₂ {s : Set A} {p : (x y : A) → x ∈ adjoin R s →
529529
(mem_mem : ∀ (x) (y) (hx : x ∈ s) (hy : y ∈ s), p x y (subset_adjoin R s hx)
530530
(subset_adjoin R s hy))
531531
(algebraMap_both : ∀ r₁ r₂, p (algebraMap R A r₁) (algebraMap R A r₂)
532-
(_root_.algebraMap_mem _ r₁) (_root_.algebraMap_mem _ r₂))
533-
(algebraMap_left : ∀ (r) (x) (hx : x ∈ s), p (algebraMap R A r) x (_root_.algebraMap_mem _ r)
532+
(algebraMap_mem _ r₁) (algebraMap_mem _ r₂))
533+
(algebraMap_left : ∀ (r) (x) (hx : x ∈ s), p (algebraMap R A r) x (algebraMap_mem _ r)
534534
(subset_adjoin R s hx))
535535
(algebraMap_right : ∀ (r) (x) (hx : x ∈ s), p x (algebraMap R A r) (subset_adjoin R s hx)
536-
(_root_.algebraMap_mem _ r))
536+
(algebraMap_mem _ r))
537537
(add_left : ∀ x y z hx hy hz, p x z hx hz → p y z hy hz → p (x + y) z (add_mem hx hy) hz)
538538
(add_right : ∀ x y z hx hy hz, p x y hx hy → p x z hx hz → p x (y + z) hx (add_mem hy hz))
539539
(mul_left : ∀ x y z hx hy hz, p x z hx hz → p y z hy hz → p (x * y) z (mul_mem hx hy) hz)

Mathlib/Analysis/Normed/Algebra/GelfandMazur.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ variable {F : Type*} [NormedRing F] [NormedAlgebra ℝ F]
262262

263263
/- A (private) abbreviation introduced for conciseness below.
264264
We will show that for every `x : F`, `φ x` takes the value zero. -/
265-
private abbrev φ (x : F) (u : ℝ × ℝ) : F := x ^ 2 - u.1 • x + algebraMap ℝ F u.2
265+
private noncomputable abbrev φ (x : F) (u : ℝ × ℝ) : F := x ^ 2 - u.1 • x + algebraMap ℝ F u.2
266266

267267
private lemma continuous_φ (x : F) : Continuous (φ x) := by fun_prop
268268

Mathlib/FieldTheory/IntermediateField/Adjoin/Defs.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ theorem adjoin_induction {s : Set E} {p : ∀ x ∈ adjoin F s, Prop}
484484
{x} (h : x ∈ adjoin F s) : p x h :=
485485
Subfield.closure_induction
486486
(fun x hx ↦ Or.casesOn hx (fun ⟨x, hx⟩ ↦ hx ▸ algebraMap x) (mem x))
487-
(by simp_rw [← (_root_.algebraMap F E).map_one]; exact algebraMap 1) add
487+
(by simp_rw [← (Algebra.algebraMap F E).map_one]; exact algebraMap 1) add
488488
(fun x _ h ↦ by
489489
simp_rw [← neg_one_smul F x, Algebra.smul_def]; exact mul _ _ _ _ (algebraMap _) h) inv mul h
490490

Mathlib/LinearAlgebra/CliffordAlgebra/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ theorem induction {C : CliffordAlgebra Q → Prop}
191191
mul_mem' := @mul
192192
add_mem' := @add
193193
algebraMap_mem' := algebraMap }
194-
let of : { f : M →ₗ[R] s // ∀ m, f m * f m = _root_.algebraMap _ _ (Q m) } :=
194+
let of : { f : M →ₗ[R] s // ∀ m, f m * f m = Algebra.algebraMap _ _ (Q m) } :=
195195
⟨(CliffordAlgebra.ι Q).codRestrict (Subalgebra.toSubmodule s) ι,
196196
fun m => Subtype.ext <| ι_sq_scalar Q m⟩
197197
-- the mapping through the subalgebra is the identity

Mathlib/RingTheory/Localization/Integral.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ theorem IsLocalization.scaleRoots_commonDenom_mem_lifts (p : Rₘ[X])
257257
theorem IsIntegral.exists_multiple_integral_of_isLocalization [Algebra Rₘ S] [IsScalarTower R Rₘ S]
258258
(x : S) (hx : IsIntegral Rₘ x) : ∃ m : M, IsIntegral R (m • x) := by
259259
rcases subsingleton_or_nontrivial Rₘ with _ | nontriv
260-
· haveI := (_root_.algebraMap Rₘ S).codomain_trivial
260+
· haveI := (algebraMap Rₘ S).codomain_trivial
261261
exact ⟨1, Polynomial.X, Polynomial.monic_X, Subsingleton.elim _ _⟩
262262
obtain ⟨p, hp₁, hp₂⟩ := hx
263263
-- Porting note: obtain doesn't support side goals

Mathlib/RingTheory/OrderOfVanishing/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ lemma ord_le_ord_mul (a : R) (x : R) : ord R x ≤ ord R (a * x) := by
182182
let g : (R ⧸ Ideal.span {a * x}) →ₗ[R] (R ⧸ Ideal.span {x}) := Submodule.factor this
183183
refine Module.length_le_of_surjective (Submodule.factor this) (Submodule.factor_surjective this)
184184
rw [Ideal.span_singleton_le_span_singleton]
185-
exact Dvd.intro_left (Algebra.algebraMap a) rfl
185+
exact Dvd.intro_left (algebraMap R R a) rfl
186186

187187
lemma ord_le_ord_of_dvd {a x : R} (h : a ∣ x) : ord R a ≤ ord R x := by
188188
obtain ⟨b, rfl⟩ := h

Mathlib/Tactic/Module.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ variable (R)
202202
commutative semiring, by applying to each `S`-component the algebra-map from `S` into a specified
203203
`S`-algebra `R`. -/
204204
def algebraMap [CommSemiring S] [Semiring R] [Algebra S R] (l : NF S M) : NF R M :=
205-
l.map (fun ⟨s, x⟩ ↦ (_root_.algebraMap S R s, x))
205+
l.map (fun ⟨s, x⟩ ↦ (Algebra.algebraMap S R s, x))
206206

207207
theorem eval_algebraMap [CommSemiring S] [Semiring R] [Algebra S R] [AddMonoid M] [SMul S M]
208208
[MulAction R M] [IsScalarTower S R M] (l : NF S M) :

Mathlib/Topology/Algebra/StarSubalgebra.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ lemma le_centralizer_centralizer [T2Space A] (x : A) :
237237
theorem induction_on {x y : A}
238238
(hy : y ∈ elemental R x) {P : (u : A) → u ∈ elemental R x → Prop}
239239
(self : P x (self_mem R x)) (star_self : P (star x) (star_self_mem R x))
240-
(algebraMap : ∀ r, P (algebraMap R A r) (_root_.algebraMap_mem _ r))
240+
(algebraMap : ∀ r, P (algebraMap R A r) (algebraMap_mem _ r))
241241
(add : ∀ u hu v hv, P u hu → P v hv → P (u + v) (add_mem hu hv))
242242
(mul : ∀ u hu v hv, P u hu → P v hv → P (u * v) (mul_mem hu hv))
243243
(closure : ∀ s : Set A, (hs : s ⊆ elemental R x) → (∀ u, (hu : u ∈ s) →

0 commit comments

Comments
 (0)