Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit a148d79

Browse files
kim-emj-loreaux
andcommitted
chore(*): revert #17048 (#17733)
This had merge conflicts which I've been rather reckless about resolving. Let's see what CI says. Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Jireh Loreaux <loreaujy@gmail.com>
1 parent 22feff5 commit a148d79

File tree

83 files changed

+414
-897
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+414
-897
lines changed

counterexamples/zero_divisors_in_add_monoid_algebras.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ begin
196196
rintro ⟨h⟩,
197197
refine not_lt.mpr (h (single (0 : F) (1 : F)) (_ : single 1 1 ≤ single 0 1)) ⟨1, _⟩,
198198
{ exact or.inr ⟨0, by simp [(by boom : ∀ j : F, j < 0 ↔ false)]⟩ },
199-
{ simp only [(by boom : ∀ j : F, j < 1 ↔ j = 0), of_lex_add, finsupp.coe_add, pi.to_lex_apply,
199+
{ simp only [(by boom : ∀ j : F, j < 1 ↔ j = 0), of_lex_add, coe_add, pi.to_lex_apply,
200200
pi.add_apply, forall_eq, f010, f1, eq_self_iff_true, f011, f111, zero_add, and_self] },
201201
end
202202

src/algebra/group/opposite.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ unop_injective.add_monoid _ rfl (λ _ _, rfl) (λ _ _, rfl)
4141

4242
instance [add_monoid_with_one α] : add_monoid_with_one αᵐᵒᵖ :=
4343
{ nat_cast := λ n, op n,
44-
nat_cast_zero := show op ((0 : ℕ) : α) = 0, by simp [nat.cast_zero],
44+
nat_cast_zero := show op ((0 : ℕ) : α) = 0, by simp,
4545
nat_cast_succ := show ∀ n, op ((n + 1 : ℕ) : α) = op (n : ℕ) + 1, by simp,
4646
.. mul_opposite.add_monoid α, .. mul_opposite.has_one α }
4747

src/algebra/group_power/lemmas.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,14 +358,14 @@ instance non_unital_non_assoc_semiring.nat_is_scalar_tower [non_unital_non_assoc
358358
| (n + 1) := by simp_rw [succ_nsmul, ←_match n, smul_eq_mul, add_mul]
359359
end
360360

361-
@[norm_cast] theorem nat.cast_pow [semiring R] (n m : ℕ) : (↑(n ^ m) : R) = ↑n ^ m :=
361+
@[simp, norm_cast] theorem nat.cast_pow [semiring R] (n m : ℕ) : (↑(n ^ m) : R) = ↑n ^ m :=
362362
begin
363363
induction m with m ih,
364364
{ rw [pow_zero, pow_zero], exact nat.cast_one },
365365
{ rw [pow_succ', pow_succ', nat.cast_mul, ih] }
366366
end
367367

368-
@[norm_cast] theorem int.coe_nat_pow (n m : ℕ) : ((n ^ m : ℕ) : ℤ) = n ^ m :=
368+
@[simp, norm_cast] theorem int.coe_nat_pow (n m : ℕ) : ((n ^ m : ℕ) : ℤ) = n ^ m :=
369369
by induction m with m ih; [exact int.coe_nat_one, rw [pow_succ', pow_succ', int.coe_nat_mul, ih]]
370370

371371
theorem int.nat_abs_pow (n : ℤ) (k : ℕ) : int.nat_abs (n ^ k) = (int.nat_abs n) ^ k :=
@@ -413,7 +413,7 @@ lemma zsmul_int_int (a b : ℤ) : a • b = a * b := by simp
413413

414414
lemma zsmul_int_one (n : ℤ) : n • 1 = n := by simp
415415

416-
@[norm_cast] theorem int.cast_pow [ring R] (n : ℤ) (m : ℕ) : (↑(n ^ m) : R) = ↑n ^ m :=
416+
@[simp, norm_cast] theorem int.cast_pow [ring R] (n : ℤ) (m : ℕ) : (↑(n ^ m) : R) = ↑n ^ m :=
417417
begin
418418
induction m with m ih,
419419
{ rw [pow_zero, pow_zero, int.cast_one] },

src/algebra/group_with_zero/units/lemmas.lean

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -155,16 +155,6 @@ end
155155

156156
@[simp] lemma map_div₀ : f (a / b) = f a / f b := map_div' f (map_inv₀ f) a b
157157

158-
@[simp]
159-
lemma coe_inv₀ [has_lift_t G₀ G₀'] [coe_is_monoid_with_zero_hom G₀ G₀']
160-
(a : G₀) : ↑(a⁻¹) = (↑a : G₀')⁻¹ :=
161-
map_inv₀ (monoid_with_zero_hom.coe G₀ G₀') a
162-
163-
@[simp]
164-
lemma coe_div₀ [has_lift_t G₀ G₀'] [coe_is_monoid_with_zero_hom G₀ G₀']
165-
(a b : G₀) : ↑(a / b) = (↑a : G₀') / ↑b :=
166-
map_div₀ (monoid_with_zero_hom.coe G₀ G₀') a b
167-
168158
end group_with_zero
169159

170160
/-- We define the inverse as a `monoid_with_zero_hom` by extending the inverse map by zero

src/algebra/hom/group.lean

Lines changed: 0 additions & 157 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,6 @@ building blocks for other homomorphisms:
2828
* `mul_hom`
2929
* `monoid_with_zero_hom`
3030
31-
Finally, we define classes that state the coercion operator `↑` (a.k.a. `coe`) is a homomorphism:
32-
* `coe_is_one_hom`/`coe_is_zero_hom`
33-
* `coe_is_mul_hom`/`coe_is_add_monoid_hom`
34-
* `coe_is_monoid_hom`/`coe_is_add_monoid_hom`
35-
* `coe_is_monoid_with_zero_hom`
36-
These come with a selection of `simp` lemmas stating that `↑` preserves the corresponding operation:
37-
`coe_add`, `coe_mul`, `coe_zero`, `coe_one`, `coe_pow`, `coe_nsmul`, `coe_zpow`, `coe_zsmul`,
38-
`coe_bit0`, `coe_bit1`, `coe_sub`, `coe_neg`, ..., etc.
39-
4031
## Notations
4132
4233
* `→+`: Bundled `add_monoid` homs. Also use for `add_group` homs.
@@ -1255,151 +1246,3 @@ instance {M N} {hM : mul_zero_one_class M} [comm_monoid_with_zero N] : has_mul (
12551246
{ to_fun := λ a, f a * g a,
12561247
map_zero' := by rw [map_zero, zero_mul],
12571248
..(f * g : M →* N) }⟩
1258-
1259-
section coe
1260-
1261-
/-! ### Coercions as bundled morphisms
1262-
1263-
The classes `coe_is_mul_hom`, `coe_is_monoid_hom`, etc. state that the coercion map `↑`
1264-
(a.k.a. `coe`) is a homomorphism.
1265-
1266-
These classes are unbundled (they take an instance of `has_lift_t R S` as a parameter, rather than
1267-
extending `has_lift_t` or one of its subclasses) for two reasons:
1268-
* We wouldn't have to introduce new classes that handle transitivity (and probably cause diamonds)
1269-
* It doesn't matter whether a coercion is written with `has_coe` or `has_lift`, you can give it
1270-
a homomorphism structure in exactly the same way.
1271-
-/
1272-
1273-
variables (M N) [has_lift_t M N]
1274-
1275-
/-- `coe_is_zero_hom M N` is a class stating that the coercion map `↑ : M → N` (a.k.a. `coe`)
1276-
is an zero-preserving homomorphism.
1277-
-/
1278-
class coe_is_zero_hom [has_zero M] [has_zero N] : Prop :=
1279-
(coe_zero : (↑(0 : M) : N) = 0)
1280-
export coe_is_zero_hom (coe_zero)
1281-
1282-
attribute [simp, norm_cast] coe_zero
1283-
1284-
/-- `coe_is_one_hom M N` is a class stating that the coercion map `↑ : M → N` (a.k.a. `coe`)
1285-
is a one-preserving homomorphism.
1286-
-/
1287-
@[to_additive]
1288-
class coe_is_one_hom [has_one M] [has_one N] : Prop :=
1289-
(coe_one : (↑(1 : M) : N) = 1)
1290-
export coe_is_one_hom (coe_one)
1291-
1292-
attribute [simp, norm_cast] coe_one
1293-
1294-
/-- `one_hom.coe M N` is the map `↑ : M → N` (a.k.a. `coe`),
1295-
bundled as a one-preserving homomorphism. -/
1296-
@[to_additive "`zero_hom.coe M N` is the map `↑ : M → N` (a.k.a. `coe`),
1297-
bundled as a zero-preserving homomorphism.", simps { fully_applied := ff }]
1298-
protected def one_hom.coe [has_one M] [has_one N] [coe_is_one_hom M N] : one_hom M N :=
1299-
{ to_fun := coe,
1300-
map_one' := coe_one }
1301-
1302-
/-- `coe_is_add_hom M N` is a class stating that the coercion map `↑ : M → N` (a.k.a. `coe`)
1303-
is an additive homomorphism.
1304-
-/
1305-
class coe_is_add_hom [has_add M] [has_add N] : Prop :=
1306-
(coe_add : ∀ (x y : M), (↑(x + y) : N) = ↑x + ↑y)
1307-
export coe_is_add_hom (coe_add)
1308-
1309-
attribute [simp, norm_cast] coe_add
1310-
1311-
/-- `coe_is_mul_hom M N` is a class stating that the coercion map `↑ : M → N` (a.k.a. `coe`)
1312-
is a multiplicative homomorphism.
1313-
-/
1314-
@[to_additive]
1315-
class coe_is_mul_hom [has_mul M] [has_mul N] : Prop :=
1316-
(coe_mul : ∀ (x y : M), (↑(x * y) : N) = ↑x * ↑y)
1317-
export coe_is_mul_hom (coe_mul)
1318-
1319-
attribute [simp, norm_cast] coe_mul
1320-
1321-
/-- `mul_hom.coe M N` is the map `↑ : M → N` (a.k.a. `coe`),
1322-
bundled as a multiplicative homomorphism. -/
1323-
@[to_additive "`add_hom.coe M N` is the map `↑ : M → N` (a.k.a. `coe`),
1324-
bundled as an additive homomorphism.", simps { fully_applied := ff }]
1325-
protected def mul_hom.coe [has_mul M] [has_mul N] [coe_is_mul_hom M N] : mul_hom M N :=
1326-
{ to_fun := coe,
1327-
map_mul' := coe_mul }
1328-
1329-
@[simp, norm_cast]
1330-
lemma coe_bit0 [has_add M] [has_add N] [coe_is_add_hom M N]
1331-
(x : M) : ↑(bit0 x) = bit0 (↑x : N) :=
1332-
coe_add _ _
1333-
1334-
@[simp, norm_cast]
1335-
lemma coe_bit1 [has_one M] [has_add M] [has_one N] [has_add N] [coe_is_one_hom M N]
1336-
[coe_is_add_hom M N] (x : M) :
1337-
↑(bit1 x) = bit1 (↑x : N) :=
1338-
by simp [bit1]
1339-
1340-
/-- `coe_is_add_monoid_hom M N` is a class stating that the coercion map `↑ : M → N` (a.k.a. `coe`)
1341-
is an additive monoid homomorphism.
1342-
-/
1343-
class coe_is_add_monoid_hom [add_zero_class M] [add_zero_class N]
1344-
extends coe_is_zero_hom M N, coe_is_add_hom M N
1345-
1346-
/-- `coe_is_monoid_hom M N` is a class stating that the coercion map `↑ : M → N` (a.k.a. `coe`)
1347-
is a monoid homomorphism.
1348-
-/
1349-
@[to_additive]
1350-
class coe_is_monoid_hom [mul_one_class M] [mul_one_class N]
1351-
extends coe_is_one_hom M N, coe_is_mul_hom M N
1352-
1353-
-- `to_additive` doesn't seem to map these correctly...
1354-
attribute [to_additive coe_is_add_monoid_hom.to_coe_is_zero_hom] coe_is_monoid_hom.to_coe_is_one_hom
1355-
attribute [to_additive coe_is_add_monoid_hom.to_coe_is_add_hom] coe_is_monoid_hom.to_coe_is_mul_hom
1356-
1357-
/-- `monoid_hom.coe M N` is the map `↑ : M → N` (a.k.a. `coe`),
1358-
bundled as a monoid homomorphism. -/
1359-
@[to_additive "`add_monoid_hom.coe M N` is the map `↑ : M → N` (a.k.a. `coe`),
1360-
bundled as an additive monoid homomorphism.", simps { fully_applied := ff }]
1361-
protected def monoid_hom.coe [mul_one_class M] [mul_one_class N] [coe_is_monoid_hom M N] : M →* N :=
1362-
{ to_fun := coe,
1363-
.. one_hom.coe M N,
1364-
.. mul_hom.coe M N }
1365-
1366-
variables {M N}
1367-
1368-
@[simp, norm_cast, to_additive]
1369-
lemma coe_pow [monoid M] [monoid N] [coe_is_monoid_hom M N]
1370-
(a : M) (n : ℕ) : ↑(a ^ n) = (↑a : N) ^ n :=
1371-
map_pow (monoid_hom.coe M N) a n
1372-
1373-
@[simp, norm_cast, to_additive]
1374-
lemma coe_zpow [group M] [group N] [coe_is_monoid_hom M N]
1375-
(a : M) (n : ℤ) : ↑(a ^ n) = (↑a : N) ^ n :=
1376-
map_zpow (monoid_hom.coe M N) a n
1377-
1378-
@[simp, norm_cast, to_additive]
1379-
lemma coe_inv [group G] [division_monoid H] [has_lift_t G H] [coe_is_monoid_hom G H]
1380-
(a : G) : ↑(a⁻¹) = (↑a : H)⁻¹ :=
1381-
map_inv (monoid_hom.coe G H) a
1382-
1383-
@[simp, norm_cast, to_additive]
1384-
lemma coe_div [group G] [division_monoid H] [has_lift_t G H] [coe_is_monoid_hom G H]
1385-
(a b : G) : ↑(a / b) = (↑a : H) / ↑b :=
1386-
map_div (monoid_hom.coe G H) a b
1387-
1388-
variables (M N)
1389-
1390-
/-- `coe_monoid_with-zero_hom M N` is a class stating that the coercion map `↑ : M → N`
1391-
(a.k.a. `coe`) is a monoid with zero homomorphism.
1392-
-/
1393-
class coe_is_monoid_with_zero_hom [monoid_with_zero M] [monoid_with_zero N]
1394-
extends coe_is_monoid_hom M N, coe_is_zero_hom M N
1395-
1396-
/-- `monoid_with_zero_hom.coe M N` is the map `↑ : M → N` (a.k.a. `coe`),
1397-
bundled as a monoid with zero homomorphism. -/
1398-
@[simps { fully_applied := ff }]
1399-
protected def monoid_with_zero_hom.coe [monoid_with_zero M] [monoid_with_zero N]
1400-
[coe_is_monoid_with_zero_hom M N] : M →*₀ N :=
1401-
{ to_fun := coe,
1402-
.. monoid_hom.coe M N,
1403-
.. zero_hom.coe M N }
1404-
1405-
end coe

src/algebra/hom/group_action.lean

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -354,55 +354,3 @@ def is_invariant_subring.subtype_hom : U →+*[M] R' :=
354354
(is_invariant_subring.subtype_hom M U : U →+* R') = U.subtype := rfl
355355

356356
end
357-
358-
section coe
359-
360-
variables (M' X Y)
361-
362-
/-- `coe_is_smul_hom M X Y` is a class stating that the coercion map `↑ : X → Y`
363-
(a.k.a. `coe`) preserves scalar multiplication by `M`.
364-
365-
Note that there is no class corresponding to `mul_action`, `distrib_mul_action` or
366-
`mul_semiring_action`: instead we assume `coe_is_smul_hom` and `coe_is_add_monoid_hom` or
367-
`coe_is_ring_hom` in separate parameters.
368-
This is because `coe_is_smul_hom` has a different set of parameters from those other classes,
369-
so extending both classes at once wouldn't work.
370-
-/
371-
class coe_is_smul_hom [has_lift_t X Y] :=
372-
(coe_smul : ∀ (c : M') (x : X), ↑(c • x) = c • (↑x : Y))
373-
374-
export coe_is_smul_hom (coe_smul)
375-
376-
attribute [simp, norm_cast] coe_smul
377-
378-
/-- `mul_action_hom.coe X Y` is the map `↑ : M → N` (a.k.a. `coe`),
379-
bundled as a scalar-multiplication preserving map. -/
380-
@[simps { fully_applied := ff }]
381-
protected def mul_action_hom.coe [has_lift_t X Y] [coe_is_smul_hom M' X Y] : X →[M'] Y :=
382-
{ to_fun := coe,
383-
map_smul' := coe_smul }
384-
385-
variables (M A B)
386-
387-
/-- `distrib_mul_action_hom.coe X Y` is the map `↑ : M → N` (a.k.a. `coe`),
388-
bundled as an equivariant additive monoid homomorphism. -/
389-
@[simps { fully_applied := ff }]
390-
protected def distrib_mul_action_hom.coe [has_lift_t A B] [coe_is_add_monoid_hom A B]
391-
[coe_is_smul_hom M A B] : A →+[M] B :=
392-
{ to_fun := coe,
393-
.. mul_action_hom.coe M A B,
394-
.. add_monoid_hom.coe A B }
395-
396-
variables (M X Y)
397-
398-
/-- `mul_semiring_action_hom.coe X Y` is the map `↑ : M → N` (a.k.a. `coe`),
399-
bundled as an equivariant semiring homomorphism. -/
400-
@[simps { fully_applied := ff }]
401-
protected def mul_semiring_action_hom.coe [has_lift_t R S] [coe_is_ring_hom R S]
402-
[coe_is_smul_hom M R S] :
403-
R →+*[M] S :=
404-
{ to_fun := coe,
405-
.. distrib_mul_action_hom.coe M R S,
406-
.. ring_hom.coe R S }
407-
408-
end coe

src/algebra/hom/group_instances.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def add_monoid_hom.mul : R →+ R →+ R :=
233233
lemma add_monoid_hom.mul_apply (x y : R) : add_monoid_hom.mul x y = x * y := rfl
234234

235235
@[simp]
236-
protected lemma add_monoid_hom.coe_mul :
236+
lemma add_monoid_hom.coe_mul :
237237
⇑(add_monoid_hom.mul : R →+ R →+ R) = add_monoid_hom.mul_left := rfl
238238

239239
@[simp]

src/algebra/hom/ring.lean

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -561,49 +561,3 @@ def mk_ring_hom_of_mul_self_of_two_ne_zero (h : ∀ x, f (x * x) = f x * f x) (h
561561
by { ext, refl }
562562

563563
end add_monoid_hom
564-
565-
section coe
566-
567-
variables (R S : Type*) [has_lift_t R S]
568-
569-
/-- `coe_is_non_unital_ring_hom R S` is a class stating that the coercion map `↑ : R → S`
570-
(a.k.a. `coe`) is a non-unital ring homomorphism.
571-
-/
572-
class coe_is_non_unital_ring_hom [non_unital_non_assoc_semiring R] [non_unital_non_assoc_semiring S]
573-
extends coe_is_mul_hom R S, coe_is_add_monoid_hom R S
574-
575-
/-- `non_unital_ring_hom.coe M N` is the map `↑ : M → N` (a.k.a. `coe`),
576-
bundled as a non-unital ring homomorphism. -/
577-
@[simps { fully_applied := ff }]
578-
protected def non_unital_ring_hom.coe [non_unital_non_assoc_semiring R]
579-
[non_unital_non_assoc_semiring S] [coe_is_non_unital_ring_hom R S] : R →ₙ+* S :=
580-
{ to_fun := coe,
581-
.. mul_hom.coe R S,
582-
.. add_monoid_hom.coe R S }
583-
584-
/-- `coe_is_ring_hom R S` is a class stating that the coercion map `↑ : R → S` (a.k.a. `coe`)
585-
is a ring homomorphism.
586-
-/
587-
class coe_is_ring_hom [non_assoc_semiring R] [non_assoc_semiring S]
588-
extends coe_is_monoid_hom R S, coe_is_add_monoid_hom R S
589-
590-
@[priority 100] -- See note [lower instance priority]
591-
instance coe_is_ring_hom.to_coe_is_non_unital_ring_hom [non_assoc_semiring R] [non_assoc_semiring S]
592-
[inst : coe_is_ring_hom R S] : coe_is_non_unital_ring_hom R S :=
593-
{ .. inst }
594-
595-
@[priority 100] -- See note [lower instance priority]
596-
instance coe_is_ring_hom.to_coe_is_monoid_with_zero_hom [semiring R] [semiring S]
597-
[inst : coe_is_ring_hom R S] : coe_is_monoid_with_zero_hom R S :=
598-
{ .. inst }
599-
600-
/-- `ring_hom.coe M N` is the map `↑ : M → N` (a.k.a. `coe`),
601-
bundled as a ring homomorphism. -/
602-
@[simps { fully_applied := ff }]
603-
protected def ring_hom.coe [non_assoc_semiring R] [non_assoc_semiring S] [coe_is_ring_hom R S] :
604-
R →+* S :=
605-
{ to_fun := coe,
606-
.. monoid_hom.coe R S,
607-
.. add_monoid_hom.coe R S }
608-
609-
end coe

0 commit comments

Comments
 (0)