@@ -69,20 +69,20 @@ Definition jacobi_identity (T : zmodType) (op : T -> T -> T) := forall x y z,
6969
7070Reserved Notation "lie[ t1 , t2 ]" (format "lie[ t1 , t2 ]").
7171
72- HB.mixin Record isLieAlgebra (R : ringType ) L of GRing.Lmodule R L := {
72+ HB.mixin Record isLieAlgebra (R : nzRingType ) L of GRing.Lmodule R L := {
7373 bracket : {bilinear L -> L -> L} ;
7474 liexx : forall x, bracket x x = 0 ;
7575 jacobi : jacobi_identity bracket
7676}.
7777
7878#[short(type="lieAlgebraType")]
79- HB.structure Definition LieAlgebra (R : ringType ) :=
79+ HB.structure Definition LieAlgebra (R : nzRingType ) :=
8080 {L of isLieAlgebra R L & }.
8181
8282Notation "lie[ t1 , t2 ]" := (@bracket _ _ t1 t2).
8383
8484Section liealgebra.
85- Variables (R : ringType ) (G : lieAlgebraType R).
85+ Variables (R : nzRingType ) (G : lieAlgebraType R).
8686
8787(* Lie brackets are anticommutative *)
8888Lemma lieC (x y : G) : lie[x, y] = - lie[y, x].
9595End liealgebra.
9696
9797Section dot_product0.
98- Variables (R : ringType ) (n : nat).
98+ Variables (R : pzRingType ) (n : nat).
9999Implicit Types u v w : 'rV[R]_n.
100100
101101Definition dotmul u v : R := (u *m v^T) ``_ 0.
@@ -170,7 +170,7 @@ Notation "u *d w" := (dotmul u w) : ring_scope.
170170
171171Section com_dot_product.
172172
173- Variables (R : comRingType ) (n : nat).
173+ Variables (R : comPzRingType ) (n : nat).
174174
175175Implicit Types u v : 'rV[R]_n.
176176
@@ -194,9 +194,9 @@ Structure revop X Y Z (f : Y -> X -> Z) := RevOp {
194194 _ : forall x, f x =1 fun_of_revop^~ x
195195}.
196196
197- Section dotmul_bilinear .
197+ Section dotmul_bilinear_Pz .
198198
199- Variables (R : comRingType ) (n : nat).
199+ Variables (R : comPzRingType ) (n : nat).
200200
201201Definition dotmul_rev (v u : 'rV[R]_n) := u *d v.
202202Canonical rev_dotmul := @RevOp _ _ _ dotmul_rev (@dotmul R n)
@@ -214,6 +214,11 @@ Proof. move=> /= k u w; by rewrite /dotmul_rev dotmulDl dotmulZv. Qed.
214214HB.instance Definition _ v :=
215215 GRing.isLinear.Build _ _ _ _ (@dotmul_rev v) (dotmul_rev_is_linear v).
216216
217+ End dotmul_bilinear_Pz.
218+
219+ Section dotmul_bilinear_Nz.
220+ Variables (R : comNzRingType) (n : nat).
221+
217222Lemma dotmul_is_bilinear : bilinear_for
218223 (GRing.Scale.Law.clone _ _ *:%R _) (GRing.Scale.Law.clone _ _ *:%R _)
219224 (@dotmul R n : _ -> _ -> R^o).
@@ -228,7 +233,7 @@ HB.instance Definition _ :=
228233 [the lmodType R of 'rV[R]_n] [the lmodType R of 'rV[R]_n]
229234 R^o _ _ (@dotmul R n) dotmul_is_bilinear.
230235
231- End dotmul_bilinear .
236+ End dotmul_bilinear_Nz .
232237
233238Section dot_product.
234239
@@ -421,7 +426,7 @@ Notation "u _|_ A , B " := (u _|_ (col_mx A B)).
421426
422427Section orthogonal_rotation_def.
423428
424- Variables (n : nat) (T : ringType ).
429+ Variables (n : nat) (T : pzRingType ).
425430
426431Definition orthogonal_pred := fun M : 'M[T]_n => M *m M^T == 1%:M.
427432Definition orthogonal := [qualify M : 'M[T]_n | orthogonal_pred M].
@@ -441,7 +446,7 @@ Notation "''SO[' T ]_ n" := (@rotation n T) : ring_scope.
441446
442447Section orthogonal_rotation_properties0.
443448
444- Variables (n' : nat) (T : ringType ).
449+ Variables (n' : nat) (T : pzRingType ).
445450Let n := n'.+1.
446451
447452Lemma orthogonalE M : (M \is 'O[T]_n) = (M * M^T == 1). Proof . by []. Qed .
482487
483488End orthogonal_rotation_properties0.
484489
485- Lemma SOSn_SOn (T : comRingType ) n m (P : 'M[T]_n.+1) :
490+ Lemma SOSn_SOn (T : comPzRingType ) n m (P : 'M[T]_n.+1) :
486491 (block_mx (1%:M : 'M_m) 0 0 P \is 'SO[T]_(m + n.+1)) = (P \is 'SO[T]_n.+1).
487492Proof . by rewrite qualifE /rotation_pred OSn_On det_lblock det1 mul1r. Qed .
488493
603608
604609End orthogonal_rotation_properties1.
605610
606- Lemma orthogonal2P (T : ringType ) M : reflect (M \is 'O[T]_2)
611+ Lemma orthogonal2P (T : pzRingType ) M : reflect (M \is 'O[T]_2)
607612 [&& row 0 M *d row 0 M == 1, row 0 M *d row 1 M == 0,
608613 row 1 M *d row 0 M == 0 & row 1 M *d row 1 M == 1].
609614Proof .
@@ -658,7 +663,7 @@ apply/eqP; rewrite -(@eqrXn2 _ 2) // ?norm_ge0 // expr1n; apply/eqP.
658663rewrite -dotmulvv; move/orthogonalP : MSO => /(_ i i) ->; by rewrite eqxx.
659664Qed .
660665
661- Lemma dot_row_of_O (T : ringType ) n M : M \is 'O[T]_n.+1 -> forall i j,
666+ Lemma dot_row_of_O (T : pzRingType ) n M : M \is 'O[T]_n.+1 -> forall i j,
662667 row i M *d row j M = (i == j)%:R.
663668Proof . by move/orthogonalP. Qed .
664669
@@ -670,7 +675,7 @@ rewrite -(@eqrXn2 _ 2) // ?norm_ge0 // expr1n -dotmulvv tr_col dotmulvv.
670675by rewrite norm_row_of_O ?expr1n // orthogonalV.
671676Qed .
672677
673- Lemma orth_preserves_sqr_norm (T : comRingType ) n M : M \is 'O[T]_n.+1 ->
678+ Lemma orth_preserves_sqr_norm (T : comPzRingType ) n M : M \is 'O[T]_n.+1 ->
674679 {mono (fun u => u *m M) : x / x *d x}.
675680Proof .
676681move=> HM u; rewrite dotmul_trmx -mulmxA (_ : M *m _ = 1%:M) ?mulmx1 //.
@@ -736,7 +741,7 @@ by move/allP => /(_ j (mem_index_enum _)); rewrite eq_sym ij implyTb mxE sqrf_eq
736741Qed .
737742
738743Section Crossproduct.
739- Variable (R : comRingType ) (n' : nat).
744+ Variable (R : comPzRingType ) (n' : nat).
740745Let n := n'.+1.
741746
742747Definition cross (u : 'M[R]_(n', n)) : 'rV_n :=
797802End Crossproduct_fieldType.
798803
799804Section row2.
800- Variable R : ringType .
805+ Variable R : pzRingType .
801806
802807Definition row2 (a b : R) : 'rV[R]_2 :=
803808 \row_p [eta \0 with 0 |-> a, 1 |-> b] p.
@@ -808,7 +813,7 @@ Proof. by apply/rowP=> j; rewrite !mxE /=; case: ifPn=> [|/ifnot01P]/eqP->. Qed.
808813End row2.
809814
810815Section row3.
811- Variable R : ringType .
816+ Variable R : pzRingType .
812817Implicit Types a b c : R.
813818
814819Definition row3 a b c : 'rV[R]_3 :=
@@ -902,7 +907,7 @@ Lemma norm_row3z (T : rcfType) (z : T) : norm (row3 0 0 z) = `|z|.
902907Proof . by rewrite /norm dotmulE sum3E !mxE /= ?(mul0r,add0r) sqrtr_sqr. Qed .
903908
904909Section col_mx2.
905- Variable (T : ringType ).
910+ Variable (T : pzRingType ).
906911Implicit Types (u v : 'rV[T]_2) (M : 'M[T]_2).
907912
908913Definition col_mx2 u v := \matrix_(i < 2) [eta \0 with 0 |-> u, 1 |-> v] i.
952957End col_mx2.
953958
954959Section col_mx3.
955- Variable (T : ringType ).
960+ Variable (T : pzRingType ).
956961Implicit Types (u v w : 'rV[T]_3) (M : 'M[T]_3).
957962
958963Definition col_mx3 u v w :=
@@ -1025,14 +1030,14 @@ Qed.
10251030End col_mx3.
10261031
10271032(* extra? *)
1028- Lemma vec3E (T : ringType ) (u : 'rV[T]_3) :
1033+ Lemma vec3E (T : pzRingType ) (u : 'rV[T]_3) :
10291034 u = (u``_0) *: 'e_0 + (u``_1) *: 'e_1 + (u``_2%:R) *: 'e_2%:R.
10301035Proof . rewrite [LHS]row3_proj e0row e1row e2row !row3Z. by Simp.r. Qed .
10311036
1032- Lemma mx_lin1K (T : ringType ) (Q : 'M[T]_3) : lin1_mx (mx_lin1 Q) = Q.
1037+ Lemma mx_lin1K (T : pzRingType ) (Q : 'M[T]_3) : lin1_mx (mx_lin1 Q) = Q.
10331038Proof . apply/matrix3P; by rewrite !mxE !sum3E !mxE !eqxx /=; Simp.r. Qed .
10341039
1035- Lemma mxtrace_sqr (T : comRingType ) (M : 'M[T]_3) : \tr (M ^+ 2) =
1040+ Lemma mxtrace_sqr (T : comPzRingType ) (M : 'M[T]_3) : \tr (M ^+ 2) =
10361041 \sum_i (M i i ^+2) + M 0 1 * M 1 0 *+ 2 + M 0 2%:R * M 2%:R 0 *+ 2 +
10371042 M 1 2%:R * M 2%:R 1 *+ 2.
10381043Proof .
@@ -1050,21 +1055,21 @@ by rewrite mulrC.
10501055Qed .
10511056(* \extra? *)
10521057
1053- Definition crossmul {R : ringType } (u v : 'rV[R]_3) :=
1058+ Definition crossmul {R : pzRingType } (u v : 'rV[R]_3) :=
10541059 locked (\row_(k < 3) \det (col_mx3 'e_k u v)).
10551060
10561061Notation "*v%R" := (@crossmul _) : ring_scope.
10571062Notation "u *v w" := (crossmul u w) : ring_scope.
10581063
1059- Lemma cross3E {R : comRingType } (u v : 'rV[R]_3) :
1064+ Lemma cross3E {R : comPzRingType } (u v : 'rV[R]_3) :
10601065 cross (col_mx u v) = u *v v.
10611066Proof .
10621067rewrite /crossmul; unlock.
10631068by apply/rowP => /= i; rewrite !mxE col_mx3E.
10641069Qed .
10651070
1066- Section crossmullie .
1067- Variable R : comRingType .
1071+ Section crossmullie_Pz .
1072+ Variable R : comPzRingType .
10681073Implicit Types u v w : 'rV[R]_3.
10691074
10701075Lemma crossmulE u v : (u *v v) = row3
@@ -1128,6 +1133,12 @@ Qed.
11281133
11291134HB.instance Definition _ u := GRing.isLinear.Build _ _ _ _ (crossmulr u) (crossmulr_linear u).
11301135
1136+ End crossmullie_Pz.
1137+
1138+ Section crossmullie_Nz.
1139+ Variable R : comNzRingType.
1140+ Implicit Types u v w : 'rV[R]_3.
1141+
11311142Lemma crossmul_is_bilinear : bilinear_for
11321143 (GRing.Scale.Law.clone _ _ *:%R _) (GRing.Scale.Law.clone _ _ *:%R _)
11331144 (crossmul : _ -> _ -> 'rV[R]_3).
@@ -1147,14 +1158,14 @@ HB.instance Definition _ :=
11471158Canonical crossmulr_is_linear u := AddLinear (crossmulr_linear u).
11481159Canonical crossmul_bilinear := [bilinear of (@crossmul R)]. *)
11491160
1150- End crossmullie .
1161+ End crossmullie_Nz .
11511162
1152- Definition vec3 (R : comRingType ) := 'rV[R]_3.
1163+ Definition vec3 (R : comPzRingType ) := 'rV[R]_3.
11531164
11541165HB.instance Definition _ R := GRing.Lmodule.on (vec3 R).
11551166
11561167Section rv3liealgebra.
1157- Variable R : comRingType .
1168+ Variable R : comNzRingType .
11581169
11591170Let liexx (u : vec3 R) : u *v u = 0.
11601171Proof .
@@ -1178,7 +1189,7 @@ HB.instance Definition _ :=
11781189End rv3liealgebra.
11791190
11801191Section crossmul_lemmas.
1181- Variable R : comRingType .
1192+ Variable R : comNzRingType .
11821193Implicit Types u v w : 'rV[R]_3.
11831194
11841195Lemma mulmxl_crossmulr M u v : M *m (u *v v) = u *v (M *m v).
@@ -1512,7 +1523,7 @@ Section properties_of_canonical_vectors.
15121523Lemma normeE (T : rcfType) i : norm ('e_i : 'rV_3) = 1 :> T.
15131524Proof . by rewrite norm_delta_mx. Qed .
15141525
1515- Variable T : comRingType .
1526+ Variable T : comPzRingType .
15161527
15171528Lemma vecij : 'e_0 *v 'e_1 = 'e_2%:R :> 'rV[T]__.
15181529Proof .
0 commit comments