1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
17 include "nat/orders.ma".
20 let rec gpow (G : abelian_group) (x : G) (n : nat) on n : G ≝
21 match n with [ O ⇒ 0 | S m ⇒ x + gpow ? x m].
23 interpretation "additive abelian group pow" 'times n x = (gpow ? x n).
25 record dgroup : Type ≝ {
26 dg_carr:> abelian_group;
27 dg_prop: ∀x:dg_carr.∀n:nat.∃y.S n * y ≈ x
30 lemma divide: ∀G:dgroup.G → nat → G.
31 intros (G x n); cases (dg_prop G x n); apply w;
34 interpretation "divisible group divide" 'divide x n = (divide ? x n).
37 ∀G:dgroup.∀x:G.∀n. S n * (x / n) ≈ x.
38 intro G; cases G; unfold divide; intros (x n); simplify;
39 cases (f x n); simplify; exact H;
42 lemma feq_mul: ∀G:dgroup.∀x,y:G.∀n.x≈y → n * x ≈ n * y.
43 intros (G x y n H); elim n; [apply eq_reflexive]
44 simplify; apply (Eq≈ (x + (n1 * y)) H1);
45 apply (Eq≈ (y+n1*y) H (eq_reflexive ??));
48 lemma div1: ∀G:dgroup.∀x:G.x/O ≈ x.
49 intro G; cases G; unfold divide; intros; simplify;
50 cases (f x O); simplify; simplify in H; intro; apply H;
51 apply (Ap≪ ? (plus_comm ???));
52 apply (Ap≪ w (zero_neutral ??)); assumption;
55 lemma apmul_ap: ∀G:dgroup.∀x,y:G.∀n.S n * x # S n * y → x # y.
56 intros 4 (G x y n); elim n; [2:
58 cases (applus ????? a); [assumption]
60 apply (plus_cancr_ap ??? 0); assumption;
63 lemma plusmul: ∀G:dgroup.∀x,y:G.∀n.n * (x+y) ≈ n * x + n * y.
64 intros (G x y n); elim n; [
65 simplify; apply (Eq≈ 0 ? (zero_neutral ? 0)); apply eq_reflexive]
66 simplify; apply eq_sym; apply (Eq≈ (x+y+(n1*x+n1*y))); [
67 apply (Eq≈ (x+(n1*x+(y+(n1*y))))); [
68 apply eq_sym; apply plus_assoc;]
69 apply (Eq≈ (x+((n1*x+y+(n1*y))))); [
70 apply feq_plusl; apply plus_assoc;]
71 apply (Eq≈ (x+(y+n1*x+n1*y))); [
72 apply feq_plusl; apply feq_plusr; apply plus_comm;]
73 apply (Eq≈ (x+(y+(n1*x+n1*y)))); [
74 apply feq_plusl; apply eq_sym; apply plus_assoc;]
76 apply feq_plusl; apply eq_sym; assumption;
79 lemma mulzero: ∀G:dgroup.∀n.n*0 ≈ 0. [2: apply dg_carr; apply G]
80 intros; elim n; [simplify; apply eq_reflexive]
81 simplify; apply (Eq≈ ? (zero_neutral ??)); assumption;
84 let rec gpowS (G : abelian_group) (x : G) (n : nat) on n : G ≝
85 match n with [ O ⇒ x | S m ⇒ gpowS ? x m + x].
87 lemma gpowS_gpow: ∀G:dgroup.∀e:G.∀n. S n * e ≈ gpowS ? e n.
88 intros (G e n); elim n; simplify; [
89 apply (Eq≈ ? (plus_comm ???));apply zero_neutral]
90 apply (Eq≈ ?? (plus_comm ???));
91 apply (Eq≈ (e+S n1*e) ? H); clear H; simplify; apply eq_reflexive;
94 lemma divpow: ∀G:dgroup.∀e:G.∀n. e ≈ gpowS ? (e/n) n.
95 intros (G e n); apply (Eq≈ ?? (gpowS_gpow ?(e/n) n));
96 apply eq_sym; apply divide_divides;