@@ -28,15 +28,6 @@ building blocks for other homomorphisms:
28
28
* `mul_hom`
29
29
* `monoid_with_zero_hom`
30
30
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
-
40
31
## Notations
41
32
42
33
* `→+`: 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 (
1255
1246
{ to_fun := λ a, f a * g a,
1256
1247
map_zero' := by rw [map_zero, zero_mul],
1257
1248
..(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
0 commit comments