Built with Alectryon, running Coq+SerAPI v8.19.0+0.19.3. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑Ctrl+↓ to navigate, Ctrl+🖱️ to focus. On Mac, use ⌘ instead of Ctrl.
[Loading ML file number_string_notation_plugin.cmxs (using legacy method) ... done]
Require Import Algebra.AbGroups.Require Import Algebra.Rings.CRing.Require Import Spaces.Int Spaces.Pos.Require Import WildCat.Core.(** * In this file we define the ring [cring_Z] of integers with underlying abelian group [abgroup_Z] defined in Algebra.AbGroups.Z. We also define multiplication by an integer in a general ring, and show that [cring_Z] is initial. *)(** The ring of integers *)
CRing
CRing
AbGroup
One ?R
Mult ?R
Commutative mult
Associative mult
LeftDistribute mult plus
LeftIdentity mult 1
AbGroup
exact abgroup_Z.
One abgroup_Z
exact1%int.
Mult abgroup_Z
exact int_mul.
Commutative mult
exact int_mul_comm.
Associative mult
exact int_mul_assoc.
LeftDistribute mult plus
exact int_dist_l.
LeftIdentity mult 1
exact int_mul_1_l.Defined.LocalOpen Scope mc_scope.(** Given a ring element [r], we get a map [Int -> R] sending an integer to that multiple of [r]. *)Definitionrng_int_mult (R : Ring) := grp_pow_homo : R -> Int -> R.(** Multiplying a ring element [r] by an integer [n] is equivalent to first multiplying the unit [1] of the ring by [n], and then multiplying the result by [r]. This is distributivity of right multiplication by [r] over the sum. *)
R: Ring r: R n: cring_Z
rng_int_mult R r n = rng_int_mult R 1 n * r
R: Ring r: R n: cring_Z
rng_int_mult R r n = rng_int_mult R 1 n * r
R: Ring r: R n: cring_Z
grp_pow r n = grp_pow 1 n * r
R: Ring r: R n: cring_Z
grp_pow r n = grp_pow (1 * r) n
byrewrite rng_mult_one_l.Defined.(** Similarly, there is a left-distributive law. *)
R: Ring r: R n: cring_Z
rng_int_mult R r n = r * rng_int_mult R 1 n
R: Ring r: R n: cring_Z
rng_int_mult R r n = r * rng_int_mult R 1 n
R: Ring r: R n: cring_Z
grp_pow r n = r * grp_pow 1 n
R: Ring r: R n: cring_Z
grp_pow r n = grp_pow (r * 1) n
byrewrite rng_mult_one_r.Defined.(** [rng_int_mult R 1] preserves multiplication. This requires that the specified ring element is the unit. *)
R: Ring
IsSemiGroupPreserving (rng_int_mult R 1)
R: Ring
IsSemiGroupPreserving (rng_int_mult R 1)
R: Ring x, y: cring_Z
rng_int_mult R 1 (sg_op x y) =
sg_op (rng_int_mult R 1 x) (rng_int_mult R 1 y)
R: Ring x, y: cring_Z
grp_pow 1 (x * y)%int = grp_pow 1 x * grp_pow 1 y
R: Ring x, y: cring_Z
grp_pow (grp_pow 1 x) y = grp_pow 1 x * grp_pow 1 y
napply rng_int_mult_dist_l.Defined.(** [rng_int_mult R 1] is a ring homomorphism *)