Skip to content

Commit 38dfa07

Browse files
chore: avoid Finset dependency in Algebra.Algebra.Defs (#16893)
1 parent ee33a2f commit 38dfa07

File tree

2 files changed

+19
-21
lines changed

2 files changed

+19
-21
lines changed

Mathlib/Algebra/Algebra/Basic.lean

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,3 +522,21 @@ lemma LinearEquiv.extendScalarsOfSurjective_symm (f : M ≃ₗ[R] N) :
522522
(f.extendScalarsOfSurjective h).symm = f.symm.extendScalarsOfSurjective h := rfl
523523

524524
end surjective
525+
526+
namespace algebraMap
527+
528+
section CommSemiringCommSemiring
529+
530+
variable {R A : Type*} [CommSemiring R] [CommSemiring A] [Algebra R A] {ι : Type*} {s : Finset ι}
531+
532+
@[norm_cast]
533+
theorem coe_prod (a : ι → R) : (↑(∏ i ∈ s, a i : R) : A) = ∏ i ∈ s, (↑(a i) : A) :=
534+
map_prod (algebraMap R A) a s
535+
536+
@[norm_cast]
537+
theorem coe_sum (a : ι → R) : ↑(∑ i ∈ s, a i) = ∑ i ∈ s, (↑(a i) : A) :=
538+
map_sum (algebraMap R A) a s
539+
540+
end CommSemiringCommSemiring
541+
542+
end algebraMap

Mathlib/Algebra/Algebra/Defs.lean

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ Copyright (c) 2018 Kenny Lau. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Kenny Lau, Yury Kudryashov
55
-/
6-
import Mathlib.Algebra.BigOperators.Group.Finset
76
import Mathlib.Algebra.Module.LinearMap.Defs
87

98
/-!
@@ -82,6 +81,7 @@ the second approach only when you need to weaken a condition on either `R` or `A
8281
-/
8382

8483
assert_not_exists Field
84+
assert_not_exists Finset
8585
assert_not_exists Module.End
8686

8787
universe u v w u₁ v₁
@@ -165,26 +165,6 @@ theorem coe_sub (a b : R) :
165165

166166
end CommRingRing
167167

168-
section CommSemiringCommSemiring
169-
170-
variable {R A : Type*} [CommSemiring R] [CommSemiring A] [Algebra R A]
171-
172-
-- direct to_additive fails because of some mix-up with polynomials
173-
@[norm_cast]
174-
theorem coe_prod {ι : Type*} {s : Finset ι} (a : ι → R) :
175-
(↑(∏ i ∈ s, a i : R) : A) = ∏ i ∈ s, (↑(a i) : A) :=
176-
map_prod (algebraMap R A) a s
177-
178-
-- to_additive fails for some reason
179-
@[norm_cast]
180-
theorem coe_sum {ι : Type*} {s : Finset ι} (a : ι → R) :
181-
↑(∑ i ∈ s, a i) = ∑ i ∈ s, (↑(a i) : A) :=
182-
map_sum (algebraMap R A) a s
183-
184-
-- Porting note: removed attribute [to_additive] coe_prod; why should this be a `to_additive`?
185-
186-
end CommSemiringCommSemiring
187-
188168
end algebraMap
189169

190170
/-- Creating an algebra from a morphism to the center of a semiring. -/

0 commit comments

Comments
 (0)