Skip to content

Commit 65847c9

Browse files
committed
Generalize expcmn to expmn, which works for any monomType
1 parent b3a9b94 commit 65847c9

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/monalg.v

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,27 @@ Local Open Scope monom_scope.
136136
#[export]
137137
HB.instance Definition _ := Monoid.isLaw.Build M 1 mmul mulmA mul1m mulm1.
138138

139+
Definition expmn (x : M) (n : nat) : M := iterop n *%M x 1%M.
140+
141+
Arguments expmn : simpl never.
142+
139143
Lemma unitmP (x y : M) : reflect (x == 1 /\ y == 1) (x * y == 1).
140144
Proof.
141145
by apply: (iffP eqP)=> [/unitm[-> ->]|[/eqP-> /eqP->]] //; rewrite mulm1.
142146
Qed.
143147

148+
Lemma expmnS (x : M) (n : nat) : expmn x n.+1 = x * expmn x n.
149+
Proof. by rewrite /expmn !Monoid.iteropE iterS. Qed.
150+
151+
Lemma expmnD (x : M) (n m : nat) : expmn x (n + m) = expmn x n * expmn x m.
152+
Proof.
153+
elim: n => [|n IHn]; first by rewrite mul1m.
154+
by rewrite addSn !expmnS IHn mulmA.
155+
Qed.
156+
157+
Lemma expmnSr (x : M) (n : nat) : expmn x n.+1 = expmn x n * x.
158+
Proof. by rewrite -addn1 expmnD. Qed.
159+
144160
End Monomial.
145161

146162
#[export]
@@ -1406,8 +1422,6 @@ Definition mulcm m1 m2 : cmonom I :=
14061422

14071423
Definition divcm m1 m2 : cmonom I := [cmonom m1 i - m2 i | i in finsupp m1]%M.
14081424

1409-
Definition expcmn m n : cmonom I := iterop n mulcm m onecm.
1410-
14111425
Lemma onecmE i : onecm i = 0%N.
14121426
Proof. by rewrite cmE fsfun_ffun insubF. Qed.
14131427

0 commit comments

Comments
 (0)