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
exact 1%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. Local Open Scope mc_scope. (** Given a ring element [r], we get a map [Int -> R] sending an integer to that multiple of [r]. *) Definition rng_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
by rewrite 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
by rewrite 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 *)
R: Ring

(cring_Z : Ring) $-> R
R: Ring

(cring_Z : Ring) $-> R
R: Ring

cring_Z -> R
R: Ring
abstract_algebra.IsSemiRingPreserving ?rng_homo_map
R: Ring

abstract_algebra.IsSemiRingPreserving (rng_int_mult R 1)
R: Ring

IsSemiGroupPreserving (rng_int_mult R 1)
R: Ring
IsSemiGroupPreserving (rng_int_mult R 1)
R: Ring
IsUnitPreserving (rng_int_mult R 1)
R: Ring

IsUnitPreserving (rng_int_mult R 1)
apply rng_plus_zero_r. Defined. (** The integers are the initial commutative ring *)

IsInitial cring_Z

IsInitial cring_Z

forall y : CRing, {f : cring_Z $-> y & forall g : cring_Z $-> y, f $== g}
R: CRing

{f : cring_Z $-> R & forall g : cring_Z $-> R, f $== g}
R: CRing

forall g : cring_Z $-> R, rng_homo_int R $== g
R: CRing
g: cring_Z $-> R
x: cring_Z

rng_homo_int R x = g x
R: CRing
g: cring_Z $-> R
x: cring_Z

grp_pow 1 x = g x
R: CRing
g: cring_Z $-> R

grp_pow 1 0%int = g 0%int
R: CRing
g: cring_Z $-> R
x: nat
IHx: grp_pow 1 x = g x
grp_pow 1 x.+1%int = g x.+1%int
R: CRing
g: cring_Z $-> R
x: nat
IHx: grp_pow 1 (- x)%int = g (- x)%int
grp_pow 1 (- x).-1%int = g (- x).-1%int
R: CRing
g: cring_Z $-> R

grp_pow 1 0%int = g 0%int
by rhs exact (grp_homo_unit g).
R: CRing
g: cring_Z $-> R
x: nat
IHx: grp_pow 1 x = g x

grp_pow 1 x.+1%int = g x.+1%int
R: CRing
g: cring_Z $-> R
x: nat
IHx: grp_pow 1 x = g x

sg_op 1 (grp_pow 1 x) = g x.+1%int
R: CRing
g: cring_Z $-> R
x: nat
IHx: grp_pow 1 x = g x

sg_op 1 (grp_pow 1 x) = g (1 + x)%int
R: CRing
g: cring_Z $-> R
x: nat
IHx: grp_pow 1 x = g x

sg_op 1 (grp_pow 1 x) = g 1 + g x
R: CRing
g: cring_Z $-> R
x: nat
IHx: grp_pow 1 x = g x

sg_op 1 (grp_pow 1 x) = 1 + g x
f_ap.
R: CRing
g: cring_Z $-> R
x: nat
IHx: grp_pow 1 (- x)%int = g (- x)%int

grp_pow 1 (- x).-1%int = g (- x).-1%int
R: CRing
g: cring_Z $-> R
x: nat
IHx: grp_pow 1 (- x)%int = g (- x)%int

sg_op (inv 1) (grp_pow 1 (- x)%int) = g (- x).-1%int
R: CRing
g: cring_Z $-> R
x: nat
IHx: grp_pow 1 (- x)%int = g (- x)%int

sg_op (inv 1) (g (- x)%int) = g (- x).-1%int
R: CRing
g: cring_Z $-> R
x: nat

sg_op (inv 1) (g (- x)%int) = g (- x).-1%int
R: CRing
g: cring_Z $-> R
x: nat

-1 + g (- x)%int = g (- x).-1%int
R: CRing
g: cring_Z $-> R
x: nat

g (-1) + g (- x)%int = g (- x).-1%int
R: CRing
g: cring_Z $-> R
x: nat

g (-1 + (- x)%int) = g (- x).-1%int
f_ap. Defined.