Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

integer group powers #1995

Merged
merged 8 commits into from
Jun 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 25 additions & 18 deletions theories/Algebra/AbGroups/AbelianGroup.v
Original file line number Diff line number Diff line change
Expand Up @@ -237,18 +237,27 @@ Proof.
induction n; cbn.
- exact (grp_unit_l _)^.
- destruct n.
+ cbn; by rewrite !grp_unit_r.
+ reflexivity.
+ simpl in IHn |- *.
rewrite IHn.
rewrite !simple_associativity.
do 2 f_ap.
rewrite (commutativity a).
rewrite <- 2 simple_associativity.
rewrite (commutativity b).
by rewrite !simple_associativity.
- (** TODO *)
Axiom transparent_admit : Empty.
snrapply (Empty_rec transparent_admit).
rewrite <- (simple_associativity a (nat_iter _ _ _)).
rewrite (simple_associativity (nat_iter n (sg_op a) a)).
rewrite (commutativity (nat_iter _ _ _) b).
rewrite <- (simple_associativity b (nat_iter _ _ _) (nat_iter _ _ _)).
rewrite (simple_associativity a).
f_ap.
- destruct n.
+ simpl.
rewrite (commutativity (- a)).
exact (grp_inv_op a b).
+ simpl in IHn |- *.
rewrite <- (simple_associativity (- a)).
rewrite (simple_associativity (nat_iter _ _ _)).
rewrite (commutativity (nat_iter _ _ _) (-b)).
rewrite <- (simple_associativity (- b)).
rewrite (simple_associativity (-a) (-b)).
rewrite (commutativity (-a) (-b)).
rewrite <- (grp_inv_op a b).
f_ap.
Defined.

Definition ab_mul_homo {A B : AbGroup}
Expand Down Expand Up @@ -301,14 +310,12 @@ Definition ab_sum_const {A : AbGroup} (n : nat) (r : A)
: ab_sum n f = grp_pow r n.
Proof.
induction n as [|n IHn] in f, p |- *.
1: reflexivity.
simpl; f_ap.
destruct n.
1: reflexivity.
rewrite IHn.
- reflexivity.
- intros k Hk.
apply p.
- rewrite (grp_pow_nat_add_1 n r).
simpl. f_ap.
rewrite IHn.
+ reflexivity.
+ intros. apply p.
Defined.

(** If the function is zero in the range of a finite sum then the sum is zero. *)
Expand Down
10 changes: 10 additions & 0 deletions theories/Algebra/Groups/Group.v
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,16 @@ Defined.

(** Note that powers don't preserve the group operation as it is not commutative. This does hold in an abelian group so such a result will appear later. *)

Definition grp_pow_nat_add_1 {G : Group} (n : nat) (g : G)
: grp_pow g (n.+1)%nat = g * grp_pow g n.
jdchristensen marked this conversation as resolved.
Show resolved Hide resolved
Proof.
induction n; simpl.
- apply (grp_unit_r g)^.
- destruct n.
+ reflexivity.
+ reflexivity.
Defined.

(** Helper functions for [grp_pow_int_add] add *)
Definition grp_pow_int_add_1 {G : Group} (n : Int) (g : G)
: grp_pow g (n.+1)%int = g * grp_pow g n.
Expand Down
Loading