Skip to content

Commit de1e713

Browse files
authored
less warnings (#47)
1 parent bd67a41 commit de1e713

File tree

14 files changed

+169
-135
lines changed

14 files changed

+169
-135
lines changed

.github/workflows/docker-action.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ jobs:
1717
strategy:
1818
matrix:
1919
image:
20-
- 'mathcomp/mathcomp:2.3.0-coq-8.20'
21-
- 'mathcomp/mathcomp:2.4.0-coq-8.20'
2220
- 'mathcomp/mathcomp:2.4.0-rocq-prover-9.0'
2321
fail-fast: false
2422
steps:

derive_matrix.v

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Import numFieldNormedType.Exports.
2626

2727
Local Open Scope ring_scope.
2828

29-
Lemma mx_lin1N (R : ringType) n (M : 'M[R]_n) :
29+
Lemma mx_lin1N (R : pzRingType) n (M : 'M[R]_n) :
3030
mx_lin1 (- M) = -1 \*: mx_lin1 M :> ( _ -> _).
3131
Proof. by rewrite funeqE => v /=; rewrite scaleN1r mulmxN. Qed.
3232

@@ -221,11 +221,11 @@ End derive_mx_SE.
221221
Section row_belast.
222222

223223
(* TODO: move? *)
224-
Definition row_belast {R : ringType} n (v : 'rV[R]_n.+1) : 'rV[R]_n :=
224+
Definition row_belast {R : pzRingType} n (v : 'rV[R]_n.+1) : 'rV[R]_n :=
225225
\row_(i < n) (v ``_ (widen_ord (leqnSn n) i)).
226226

227227
(* TODO: move? *)
228-
Lemma row_belast_last (R : ringType) n (r : 'rV[R]_n.+1) H :
228+
Lemma row_belast_last (R : pzRingType) n (r : 'rV[R]_n.+1) H :
229229
r = castmx (erefl, H) (row_mx (row_belast r) (r ``_ ord_max)%:M).
230230
Proof.
231231
apply/rowP => i; rewrite castmxE mxE.

dh.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Local Open Scope ring_scope.
3232
(* [ angeles 2014: p.102-203] *)
3333
Module Plucker.
3434
Section plucker.
35-
Variable T : ringType.
35+
Variable T : pzRingType.
3636
Let vector := 'rV[T]_3.
3737

3838
Record array := mkArray {
@@ -44,7 +44,7 @@ Record array := mkArray {
4444
End plucker.
4545
End Plucker.
4646

47-
Coercion plucker_array_mx (T : ringType) (p : Plucker.array T) :=
47+
Coercion plucker_array_mx (T : pzRingType) (p : Plucker.array T) :=
4848
row_mx (Plucker.e p) (Plucker.n p).
4949

5050
(* wip *)

differential_kinematics.v

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
(* coq-robot (c) 2017 AIST and INRIA. License: LGPL-2.1-or-later. *)
22
From mathcomp Require Import all_ssreflect ssralg ssrint ssrnum rat.
3+
From mathcomp Require Import interval_inference.
34
From mathcomp Require Import closed_field polyrcf matrix mxalgebra mxpoly zmodp.
45
From mathcomp Require Import realalg complex fingroup perm.
56
From mathcomp Require Import sesquilinear.
6-
From mathcomp Require Import boolp reals classical_sets signed.
7+
From mathcomp Require Import boolp reals classical_sets.
78
From mathcomp Require Import topology normedtype landau derive.
89
From mathcomp Require Import functions.
910
Require Import ssr_ext derive_matrix euclidean frame rot skew rigid.
@@ -41,7 +42,7 @@ Local Open Scope frame_scope.
4142

4243
Module BoundVect. (* i.e., point of application prescribed *)
4344
Section bound_vector.
44-
Variable T : ringType.
45+
Variable T : pzRingType.
4546
Record t (F : tframe T) := mk { endp : 'rV[T]_3 }.
4647
Definition startp F (v : t F) : 'rV[T]_3 := \o{F}.
4748
End bound_vector.
@@ -56,7 +57,7 @@ Reserved Notation "a \-b b" (at level 39).
5657

5758
Section about_bound_vectors.
5859

59-
Variables (T : ringType) (F : tframe T).
60+
Variables (T : pzRingType) (F : tframe T).
6061

6162
Definition FramedVect_of_Bound (p : bvec F) : fvec F := `[ BoundVect.endp p $ F ].
6263

@@ -104,7 +105,7 @@ Qed.
104105

105106
Module RFrame.
106107
Section rframe.
107-
Variable T : ringType.
108+
Variable T : pzRingType.
108109
Record t (F0 : tframe T) := mk {
109110
o : bvec F0 ;
110111
i : fvec F0 ;

euclidean.v

Lines changed: 42 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -69,20 +69,20 @@ Definition jacobi_identity (T : zmodType) (op : T -> T -> T) := forall x y z,
6969

7070
Reserved 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

8282
Notation "lie[ t1 , t2 ]" := (@bracket _ _ t1 t2).
8383

8484
Section liealgebra.
85-
Variables (R : ringType) (G : lieAlgebraType R).
85+
Variables (R : nzRingType) (G : lieAlgebraType R).
8686

8787
(* Lie brackets are anticommutative *)
8888
Lemma lieC (x y : G) : lie[x, y] = - lie[y, x].
@@ -95,7 +95,7 @@ Qed.
9595
End liealgebra.
9696

9797
Section dot_product0.
98-
Variables (R : ringType) (n : nat).
98+
Variables (R : pzRingType) (n : nat).
9999
Implicit Types u v w : 'rV[R]_n.
100100

101101
Definition dotmul u v : R := (u *m v^T) ``_ 0.
@@ -170,7 +170,7 @@ Notation "u *d w" := (dotmul u w) : ring_scope.
170170

171171
Section com_dot_product.
172172

173-
Variables (R : comRingType) (n : nat).
173+
Variables (R : comPzRingType) (n : nat).
174174

175175
Implicit 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

201201
Definition dotmul_rev (v u : 'rV[R]_n) := u *d v.
202202
Canonical rev_dotmul := @RevOp _ _ _ dotmul_rev (@dotmul R n)
@@ -214,6 +214,11 @@ Proof. move=> /= k u w; by rewrite /dotmul_rev dotmulDl dotmulZv. Qed.
214214
HB.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+
217222
Lemma 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

233238
Section dot_product.
234239

@@ -421,7 +426,7 @@ Notation "u _|_ A , B " := (u _|_ (col_mx A B)).
421426

422427
Section orthogonal_rotation_def.
423428

424-
Variables (n : nat) (T : ringType).
429+
Variables (n : nat) (T : pzRingType).
425430

426431
Definition orthogonal_pred := fun M : 'M[T]_n => M *m M^T == 1%:M.
427432
Definition orthogonal := [qualify M : 'M[T]_n | orthogonal_pred M].
@@ -441,7 +446,7 @@ Notation "''SO[' T ]_ n" := (@rotation n T) : ring_scope.
441446

442447
Section orthogonal_rotation_properties0.
443448

444-
Variables (n' : nat) (T : ringType).
449+
Variables (n' : nat) (T : pzRingType).
445450
Let n := n'.+1.
446451

447452
Lemma orthogonalE M : (M \is 'O[T]_n) = (M * M^T == 1). Proof. by []. Qed.
@@ -482,7 +487,7 @@ Qed.
482487

483488
End 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).
487492
Proof. by rewrite qualifE /rotation_pred OSn_On det_lblock det1 mul1r. Qed.
488493

@@ -603,7 +608,7 @@ Qed.
603608

604609
End 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].
609614
Proof.
@@ -658,7 +663,7 @@ apply/eqP; rewrite -(@eqrXn2 _ 2) // ?norm_ge0 // expr1n; apply/eqP.
658663
rewrite -dotmulvv; move/orthogonalP : MSO => /(_ i i) ->; by rewrite eqxx.
659664
Qed.
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.
663668
Proof. by move/orthogonalP. Qed.
664669

@@ -670,7 +675,7 @@ rewrite -(@eqrXn2 _ 2) // ?norm_ge0 // expr1n -dotmulvv tr_col dotmulvv.
670675
by rewrite norm_row_of_O ?expr1n // orthogonalV.
671676
Qed.
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}.
675680
Proof.
676681
move=> 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
736741
Qed.
737742

738743
Section Crossproduct.
739-
Variable (R : comRingType) (n' : nat).
744+
Variable (R : comPzRingType) (n' : nat).
740745
Let n := n'.+1.
741746

742747
Definition cross (u : 'M[R]_(n', n)) : 'rV_n :=
@@ -797,7 +802,7 @@ Qed.
797802
End Crossproduct_fieldType.
798803

799804
Section row2.
800-
Variable R : ringType.
805+
Variable R : pzRingType.
801806

802807
Definition 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.
808813
End row2.
809814

810815
Section row3.
811-
Variable R : ringType.
816+
Variable R : pzRingType.
812817
Implicit Types a b c : R.
813818

814819
Definition row3 a b c : 'rV[R]_3 :=
@@ -902,7 +907,7 @@ Lemma norm_row3z (T : rcfType) (z : T) : norm (row3 0 0 z) = `|z|.
902907
Proof. by rewrite /norm dotmulE sum3E !mxE /= ?(mul0r,add0r) sqrtr_sqr. Qed.
903908

904909
Section col_mx2.
905-
Variable (T : ringType).
910+
Variable (T : pzRingType).
906911
Implicit Types (u v : 'rV[T]_2) (M : 'M[T]_2).
907912

908913
Definition col_mx2 u v := \matrix_(i < 2) [eta \0 with 0 |-> u, 1 |-> v] i.
@@ -952,7 +957,7 @@ Qed.
952957
End col_mx2.
953958

954959
Section col_mx3.
955-
Variable (T : ringType).
960+
Variable (T : pzRingType).
956961
Implicit Types (u v w : 'rV[T]_3) (M : 'M[T]_3).
957962

958963
Definition col_mx3 u v w :=
@@ -1025,14 +1030,14 @@ Qed.
10251030
End 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.
10301035
Proof. 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.
10331038
Proof. 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.
10381043
Proof.
@@ -1050,21 +1055,21 @@ by rewrite mulrC.
10501055
Qed.
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

10561061
Notation "*v%R" := (@crossmul _) : ring_scope.
10571062
Notation "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.
10611066
Proof.
10621067
rewrite /crossmul; unlock.
10631068
by apply/rowP => /= i; rewrite !mxE col_mx3E.
10641069
Qed.
10651070

1066-
Section crossmullie.
1067-
Variable R : comRingType.
1071+
Section crossmullie_Pz.
1072+
Variable R : comPzRingType.
10681073
Implicit Types u v w : 'rV[R]_3.
10691074

10701075
Lemma crossmulE u v : (u *v v) = row3
@@ -1128,6 +1133,12 @@ Qed.
11281133

11291134
HB.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+
11311142
Lemma 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 _ :=
11471158
Canonical crossmulr_is_linear u := AddLinear (crossmulr_linear u).
11481159
Canonical 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

11541165
HB.instance Definition _ R := GRing.Lmodule.on (vec3 R).
11551166

11561167
Section rv3liealgebra.
1157-
Variable R : comRingType.
1168+
Variable R : comNzRingType.
11581169

11591170
Let liexx (u : vec3 R) : u *v u = 0.
11601171
Proof.
@@ -1178,7 +1189,7 @@ HB.instance Definition _ :=
11781189
End rv3liealgebra.
11791190

11801191
Section crossmul_lemmas.
1181-
Variable R : comRingType.
1192+
Variable R : comNzRingType.
11821193
Implicit Types u v w : 'rV[R]_3.
11831194

11841195
Lemma mulmxl_crossmulr M u v : M *m (u *v v) = u *v (M *m v).
@@ -1512,7 +1523,7 @@ Section properties_of_canonical_vectors.
15121523
Lemma normeE (T : rcfType) i : norm ('e_i : 'rV_3) = 1 :> T.
15131524
Proof. by rewrite norm_delta_mx. Qed.
15141525

1515-
Variable T : comRingType.
1526+
Variable T : comPzRingType.
15161527

15171528
Lemma vecij : 'e_0 *v 'e_1 = 'e_2%:R :> 'rV[T]__.
15181529
Proof.

0 commit comments

Comments
 (0)