Skip to content

Commit ba92f09

Browse files
committed
Add support for coq 8.18
Signed-off-by: Avi Shinnar <shinnar@us.ibm.com>
1 parent 495639a commit ba92f09

25 files changed

+88
-89
lines changed

.github/workflows/build.yml

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
coq_container:
1414
# - coqorg/coq:8.12.2
1515
- coqorg/coq:8.16.1-ocaml-4.13.1-flambda
16+
- coqorg/coq:8.18.0-ocaml-4.13.1-flambda
1617
container:
1718
image: ${{ matrix.coq_container }}
1819
options: --user root

_CoqProject

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
-R coq FormalML -arg -set -arg "Warnings=+default,-ambiguous-path,-typechecker,-ssr-search-moved,-deprecated,-notation-overridden"
1+
-R coq FormalML -arg -set -arg "Warnings=+default,-ambiguous-path,-coercions,-hiding-delimiting-key,-overwriting-delimiting-key,-redundant-canonical-projection,-typechecker,-ssr-search-moved,-deprecated,-notation-overridden"

coq/CertRL/LM/lax_milgram.v

+1-2
Original file line numberDiff line numberDiff line change
@@ -1005,12 +1005,11 @@ intro x; field.
10051005
repeat (rewrite Hx1 in HU0).
10061006
rewrite Rmult_comm.
10071007
trivial.
1008-
absurd (norm u0 = 0).
1008+
try revert HU0.
10091009
apply Rgt_not_eq.
10101010
apply Rlt_gt.
10111011
apply norm_gt_0.
10121012
trivial.
1013-
trivial.
10141013
apply norm_ge_0.
10151014
simpl.
10161015
apply is_finite_correct in Hfin.

coq/CertRL/qvalues.v

+5-4
Original file line numberDiff line numberDiff line change
@@ -444,10 +444,11 @@ Qed.
444444
Proof.
445445
destruct (is_nil_dec l); try now subst.
446446
apply Rle_antisym.
447-
+ rewrite Rmax_list_le_iff; try rewrite map_not_nil; try easy.
448-
intros x Hx. rewrite in_map_iff in Hx.
449-
destruct Hx as [x0 [Hx0 Hx0']].
450-
now subst. congruence.
447+
+ rewrite Rmax_list_le_iff; try rewrite map_not_nil.
448+
* intros x Hx. rewrite in_map_iff in Hx.
449+
destruct Hx as [x0 [Hx0 Hx0']].
450+
now subst.
451+
* congruence.
451452
+ apply Rmax_spec.
452453
rewrite in_map_iff.
453454
rewrite BasicUtils.ne_symm in n.

coq/FHE/encode.v

+2-2
Original file line numberDiff line numberDiff line change
@@ -1283,7 +1283,7 @@ Canonical ev_C_rmorphism (x:R[i]) := RMorphism (ev_C_is_rmorphism x).
12831283
Proof.
12841284
move=> p.
12851285
rewrite /peval_C_quot -eq_lock.
1286-
case piP => a /EquivQuot.eqmodP.
1286+
case: piP => a /EquivQuot.eqmodP.
12871287
rewrite /Quotient.equiv_equiv /Quotient.equiv /in_mem /mem /= /peval_C_ker_pred.
12881288
destruct (ev_C_is_rmorphism x).
12891289
rewrite base => eqq.
@@ -1713,7 +1713,7 @@ Section eval_vectors.
17131713
Proof.
17141714
move=> x.
17151715
rewrite /mx_eval_quot -eq_lock.
1716-
case piP => a /EquivQuot.eqmodP.
1716+
case: piP => a /EquivQuot.eqmodP.
17171717
rewrite /Quotient.equiv_equiv /Quotient.equiv /in_mem /mem /= /mx_eval_ker_pred.
17181718
destruct mx_eval_is_rmorphism.
17191719
rewrite base => eqq.

coq/NeuralNetworks/DefinedFunctions.v

+2-2
Original file line numberDiff line numberDiff line change
@@ -11783,8 +11783,8 @@ Tactic Notation "DefinedFunction_scalar_cases" tactic(first) ident(c) :=
1178311783
intros fa.
1178411784
do 2 (apply functional_extensionality; intro).
1178511785
unfold scaleUnitVector; simpl.
11786-
match_destr.
11787-
now specialize (fa x1); simpl in fa.
11786+
match_destr
11787+
; try now specialize (fa x1); simpl in fa.
1178811788
Qed.
1178911789

1179011790

coq/ProbTheory/ConditionalExpectation.v

+6-6
Original file line numberDiff line numberDiff line change
@@ -4293,7 +4293,7 @@ Section cond_exp_l2.
42934293
unfold norm, minus, plus, opp in *; simpl in *.
42944294
rewrite L2RRVq_norm_norm in HH2.
42954295
autorewrite with quot in HH2.
4296-
rewrite LpRRVq_normE in HH2.
4296+
try rewrite LpRRVq_normE in HH2.
42974297
rewrite LpRRVminus_plus.
42984298
unfold nonneg in HH2 |- *; simpl in *.
42994299
rewrite HH2.
@@ -4315,7 +4315,7 @@ Section cond_exp_l2.
43154315
exists w'.
43164316
split; trivial.
43174317
autorewrite with quot.
4318-
rewrite LpRRVq_normE.
4318+
try rewrite LpRRVq_normE.
43194319
now rewrite LpRRVminus_plus.
43204320
+ subst.
43214321
exists (Quot _ w).
@@ -4324,7 +4324,7 @@ Section cond_exp_l2.
43244324
split; trivial.
43254325
* rewrite L2RRVq_norm_norm.
43264326
autorewrite with quot.
4327-
rewrite LpRRVq_normE.
4327+
try rewrite LpRRVq_normE.
43284328
now rewrite LpRRVminus_plus.
43294329
}
43304330
repeat split.
@@ -4360,7 +4360,7 @@ Section cond_exp_l2.
43604360
eauto.
43614361
* rewrite L2RRVq_norm_norm.
43624362
autorewrite with quot.
4363-
rewrite LpRRVq_normE.
4363+
try rewrite LpRRVq_normE.
43644364
rewrite <- LpRRVminus_plus.
43654365
unfold nonneg in *; simpl in *.
43664366
rewrite xeqq.
@@ -4490,7 +4490,7 @@ Section cond_exp_l2.
44904490
rewrite L2RRVq_norm_norm.
44914491
unfold minus, plus, opp; simpl.
44924492
LpRRVq_simpl.
4493-
rewrite LpRRVq_normE.
4493+
try rewrite LpRRVq_normE.
44944494
now rewrite LpRRVminus_plus.
44954495
- intros [?[??]]; subst.
44964496
destruct H0 as [?[??]]; subst.
@@ -4500,7 +4500,7 @@ Section cond_exp_l2.
45004500
rewrite L2RRVq_norm_norm.
45014501
unfold minus, plus, opp; simpl.
45024502
LpRRVq_simpl.
4503-
rewrite LpRRVq_normE.
4503+
try rewrite LpRRVq_normE.
45044504
now rewrite LpRRVminus_plus.
45054505
Qed.
45064506

coq/ProbTheory/Expectation.v

+3-4
Original file line numberDiff line numberDiff line change
@@ -1173,7 +1173,7 @@ Section Expectation_sec.
11731173
+ split; intros.
11741174
* field_simplify in H.
11751175
-- now apply INR_eq.
1176-
-- revert H.
1176+
-- try revert H.
11771177
now apply pow_nzero.
11781178
* subst.
11791179
field_simplify; trivial.
@@ -4730,8 +4730,7 @@ Section EventRestricted.
47304730
+ typeclasses eauto.
47314731
+ intro z.
47324732
unfold lift_event_restricted_domain_fun.
4733-
match_destr.
4734-
apply H5.
4733+
match_destr; try apply H5.
47354734
+ subst.
47364735
erewrite event_restricted_SimpleExpectation; eauto.
47374736
apply SimpleExpectation_ext.
@@ -4927,7 +4926,7 @@ Section indep.
49274926
; lra.
49284927
}
49294928

4930-
generalize (simple_approx_rv
4929+
generalize (simple_approx_rv (dom:= borel_sa)
49314930
(rvchoice (fun x => if Req_EM_T (c x) 0 then false else true)
49324931
(fun x => x)
49334932
(fun _ => 0)) n).

coq/ProbTheory/Martingale.v

+3-3
Original file line numberDiff line numberDiff line change
@@ -1385,7 +1385,7 @@ Section martingale.
13851385
Global Instance martingale_transform_adapted (H X : nat -> Ts -> R) sas
13861386
{adapt:IsAdapted borel_sa X sas}
13871387
{filt:IsFiltration sas} :
1388-
is_predictable H sas ->
1388+
is_predictable (saD:=borel_sa) H sas ->
13891389
IsAdapted borel_sa (martingale_transform H X) sas.
13901390
Proof.
13911391
intros is_pre [|n]; simpl.
@@ -1419,7 +1419,7 @@ Section martingale.
14191419
{isfeS:forall n, IsFiniteExpectation prts (rvmult (H (S n)) (rvminus (X (S n)) (X n)))}
14201420
{isfe : forall n : nat, IsFiniteExpectation prts (martingale_transform H X n)}
14211421
{adapt:IsAdapted borel_sa (martingale_transform H X) sas}
1422-
(predict: is_predictable H sas)
1422+
(predict: is_predictable (saD:=borel_sa) H sas)
14231423
{mart:IsMartingale eq X sas} :
14241424
IsMartingale eq (martingale_transform H X) sas.
14251425
Proof.
@@ -1560,7 +1560,7 @@ Section martingale.
15601560
{isfeS:forall n, IsFiniteExpectation prts (rvmult (H (S n)) (rvminus (X (S n)) (X n)))}
15611561
{isfe : forall n : nat, IsFiniteExpectation prts (martingale_transform H X n)}
15621562
{adapt:IsAdapted borel_sa (martingale_transform H X) sas}
1563-
(predict: is_predictable H sas)
1563+
(predict: is_predictable (saD:=borel_sa) H sas)
15641564
(Hpos: forall n, almostR2 prts Rle (const 0) (H n))
15651565
{mart:IsMartingale Rle X sas} :
15661566
IsMartingale Rle (martingale_transform H X) sas.

coq/ProbTheory/MartingaleConvergence.v

+2-2
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ Section mct.
167167
end)))).
168168

169169
Lemma upcrossing_bound_is_predictable a b :
170-
is_predictable (upcrossing_bound a b) sas.
170+
is_predictable (saD:=borel_sa) (upcrossing_bound a b) sas.
171171
Proof.
172172
intros m.
173173
unfold upcrossing_bound.
@@ -2390,7 +2390,7 @@ Section mct.
23902390
apply Rbar_plus_le_compat
23912391
; [| now rewrite IsFiniteNonnegExpectation; try reflexivity].
23922392

2393-
assert (ispredminus1:is_predictable (fun k : nat => rvminus (const 1) (upcrossing_bound Y a b k)) sas).
2393+
assert (ispredminus1:is_predictable (saD:=borel_sa) (fun k : nat => rvminus (const 1) (upcrossing_bound Y a b k)) sas).
23942394
{
23952395
red.
23962396
apply is_adapted_minus.

coq/ProbTheory/MartingaleStopped.v

+9-5
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,8 @@ Section stopped_process.
166166
forall n, RandomVariable dom borel_sa (process_stopped_at Y T n).
167167
Proof.
168168
intros.
169-
eapply RandomVariable_proper; try apply process_stopped_at_as_alt; try reflexivity.
169+
cut (RandomVariable dom borel_sa (process_stopped_at_alt Y T n))
170+
; [apply RandomVariable_proper; try reflexivity; apply process_stopped_at_as_alt; try reflexivity |].
170171
destruct n; simpl; trivial.
171172
apply rvplus_rv.
172173
- apply rvsum_rv; intros.
@@ -186,14 +187,17 @@ Section stopped_process.
186187
IsAdapted borel_sa (process_stopped_at Y T) F.
187188
Proof.
188189
intros n.
189-
eapply (RandomVariable_proper _ (F n)); try apply process_stopped_at_as_alt; try reflexivity.
190+
cut (RandomVariable (F n) borel_sa (process_stopped_at_alt Y T n))
191+
; [apply RandomVariable_proper; try reflexivity; apply process_stopped_at_as_alt; try reflexivity |].
190192
destruct n; simpl; trivial.
191193
apply rvplus_rv.
192194
- apply rvsum_rv_loc; intros.
193195
apply rvmult_rv; trivial.
194-
+ eapply (RandomVariable_proper_le (F m) _); try reflexivity.
195-
* apply is_filtration_le; trivial; lia.
196-
* apply adapt.
196+
+ cut (RandomVariable (F m) borel_sa (Y m)).
197+
{ eapply (RandomVariable_proper_le (F m) _); try reflexivity.
198+
apply is_filtration_le; trivial; lia.
199+
}
200+
apply adapt.
197201
+ apply EventIndicator_pre_rv.
198202
generalize (is_stop m).
199203
apply is_filtration_le; trivial; lia.

coq/ProbTheory/RandomVariableFinite.v

+1-1
Original file line numberDiff line numberDiff line change
@@ -1310,7 +1310,7 @@ Lemma Fatou_FiniteExpectation
13101310

13111311
End fe.
13121312

1313-
Hint Rewrite FiniteExpectation_const FiniteExpectation_plus FiniteExpectation_scale FiniteExpectation_opp FiniteExpectation_minus: prob.
1313+
Hint Rewrite @FiniteExpectation_const @FiniteExpectation_plus @FiniteExpectation_scale @FiniteExpectation_opp @FiniteExpectation_minus: prob.
13141314

13151315
Section ExpNonNeg.
13161316
Context {Ts:Type}

coq/ProbTheory/RandomVariableL2.v

+5-4
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ Section L2.
768768
Proof.
769769
unfold Hnorm; simpl.
770770
LpRRVq_simpl.
771-
rewrite LpRRVq_normE.
771+
try rewrite LpRRVq_normE.
772772
unfold LpRRVnorm.
773773
unfold L2RRVinner.
774774
rewrite power_sqrt.
@@ -789,7 +789,7 @@ Section L2.
789789
rewrite LpRRVq_ballE.
790790
unfold minus, plus, opp; simpl.
791791
autorewrite with quot.
792-
rewrite LpRRVq_normE.
792+
try rewrite LpRRVq_normE.
793793
unfold LpRRVball.
794794
now rewrite LpRRVminus_plus.
795795
Qed.
@@ -815,7 +815,7 @@ Section L2.
815815
rewrite LpRRVq_ballE.
816816
unfold minus, plus, opp; simpl.
817817
autorewrite with quot.
818-
rewrite LpRRVq_normE.
818+
try rewrite LpRRVq_normE.
819819
unfold LpRRVball.
820820
erewrite LpRRV_norm_proper; [reflexivity |].
821821
rewrite LpRRVminus_plus.
@@ -859,7 +859,8 @@ Section L2.
859859
destruct (Quot_inv x); subst; simpl in *.
860860
unfold minus, plus, opp; simpl.
861861
autorewrite with quot.
862-
rewrite LpRRVq_ballE, LpRRVq_normE.
862+
rewrite LpRRVq_ballE.
863+
try rewrite LpRRVq_normE.
863864
unfold LpRRVball.
864865
erewrite LpRRV_norm_proper; [reflexivity |].
865866
rewrite LpRRVminus_plus.

coq/ProbTheory/RandomVariableLinf.v

+1-1
Original file line numberDiff line numberDiff line change
@@ -2348,7 +2348,7 @@ End Linf.
23482348
apply LiRRV_norm_sproper.
23492349
intros ?; simpl.
23502350
rv_unfold; lra.
2351-
- revert HH.
2351+
- try revert HH.
23522352
apply pow_nzero.
23532353
lra.
23542354
Qed.

coq/ProbTheory/RandomVariableLpNat.v

+7-7
Original file line numberDiff line numberDiff line change
@@ -1630,20 +1630,20 @@ Section Lp.
16301630

16311631
End Lp.
16321632

1633-
Hint Rewrite LpRRVq_constE : quot.
1634-
Hint Rewrite LpRRVq_zeroE : quot.
1635-
Hint Rewrite LpRRVq_scaleE : quot.
1636-
Hint Rewrite LpRRVq_oppE : quot.
1637-
Hint Rewrite LpRRVq_plusE : quot.
1638-
Hint Rewrite LpRRVq_minusE : quot.
16391633
Hint Rewrite @LpRRVq_constE : quot.
16401634
Hint Rewrite @LpRRVq_zeroE : quot.
16411635
Hint Rewrite @LpRRVq_scaleE : quot.
16421636
Hint Rewrite @LpRRVq_oppE : quot.
16431637
Hint Rewrite @LpRRVq_plusE : quot.
16441638
Hint Rewrite @LpRRVq_minusE : quot.
16451639
Hint Rewrite @LpRRVq_constE : quot.
1646-
Hint Rewrite LpRRVq_normE : quot.
1640+
Hint Rewrite @LpRRVq_zeroE : quot.
1641+
Hint Rewrite @LpRRVq_scaleE : quot.
1642+
Hint Rewrite @LpRRVq_oppE : quot.
1643+
Hint Rewrite @LpRRVq_plusE : quot.
1644+
Hint Rewrite @LpRRVq_minusE : quot.
1645+
Hint Rewrite @LpRRVq_constE : quot.
1646+
Hint Rewrite @LpRRVq_normE : quot.
16471647

16481648
Global Arguments LpRRVq_AbelianGroup {Ts} {dom} prts p.
16491649
Global Arguments LpRRVq_ModuleSpace {Ts} {dom} prts p.

coq/ProbTheory/RandomVariableLpR.v

+8-8
Original file line numberDiff line numberDiff line change
@@ -2143,20 +2143,20 @@ Qed.
21432143

21442144
End Lp.
21452145

2146-
Hint Rewrite LpRRVq_constE : quot.
2147-
Hint Rewrite LpRRVq_zeroE : quot.
2148-
Hint Rewrite LpRRVq_scaleE : quot.
2149-
Hint Rewrite LpRRVq_oppE : quot.
2150-
Hint Rewrite LpRRVq_plusE : quot.
2151-
Hint Rewrite LpRRVq_minusE : quot.
21522146
Hint Rewrite @LpRRVq_constE : quot.
21532147
Hint Rewrite @LpRRVq_zeroE : quot.
21542148
Hint Rewrite @LpRRVq_scaleE : quot.
21552149
Hint Rewrite @LpRRVq_oppE : quot.
21562150
Hint Rewrite @LpRRVq_plusE : quot.
21572151
Hint Rewrite @LpRRVq_minusE : quot.
21582152
Hint Rewrite @LpRRVq_constE : quot.
2159-
Hint Rewrite LpRRVq_normE : quot.
2153+
Hint Rewrite @LpRRVq_zeroE : quot.
2154+
Hint Rewrite @LpRRVq_scaleE : quot.
2155+
Hint Rewrite @LpRRVq_oppE : quot.
2156+
Hint Rewrite @LpRRVq_plusE : quot.
2157+
Hint Rewrite @LpRRVq_minusE : quot.
2158+
Hint Rewrite @LpRRVq_constE : quot.
2159+
Hint Rewrite @LpRRVq_normE : quot.
21602160

21612161
Global Arguments LpRRVq_AbelianGroup {Ts} {dom} prts p.
21622162
Global Arguments LpRRVq_ModuleSpace {Ts} {dom} prts p.
@@ -2441,7 +2441,7 @@ Section complete.
24412441
apply LpRRV_norm_sproper.
24422442
intros ?; simpl.
24432443
rv_unfold; lra.
2444-
- revert HH.
2444+
- try revert HH.
24452445
apply pow_nzero.
24462446
lra.
24472447
Qed.

coq/ProbTheory/RbarExpectation.v

+4-4
Original file line numberDiff line numberDiff line change
@@ -1845,8 +1845,8 @@ Section EventRestricted.
18451845
+ typeclasses eauto.
18461846
+ intro z.
18471847
unfold lift_event_restricted_domain_fun.
1848-
match_destr.
1849-
apply H5.
1848+
match_destr
1849+
; try apply H5.
18501850
+ subst.
18511851
erewrite event_restricted_SimpleExpectation; eauto.
18521852
apply SimpleExpectation_ext.
@@ -4709,7 +4709,7 @@ Section rv_expressible.
47094709
(X : nat -> Ts -> R) (n : nat)
47104710
(Y : Ts -> R)
47114711
{rv_X : forall n, RandomVariable dom borel_sa (X n)}
4712-
{rv_y : RandomVariable (filtration_history_sa X n) borel_sa Y} :
4712+
{rv_y : RandomVariable (filtration_history_sa (cod:=borel_sa) X n) borel_sa Y} :
47134713
exists g : vector R (S n) -> R,
47144714
RandomVariable (Rvector_borel_sa (S n)) borel_sa g /\
47154715
rv_eq Y (g ∘ (make_vector_from_seq X (S n))).
@@ -4736,7 +4736,7 @@ Section rv_expressible.
47364736
(X : nat -> Ts -> R) (n : nat)
47374737
(g : vector R (S n) -> R)
47384738
{rv_g : RandomVariable (Rvector_borel_sa (S n)) borel_sa g} :
4739-
RandomVariable (filtration_history_sa X n) borel_sa (g ∘ (make_vector_from_seq X (S n) )).
4739+
RandomVariable (filtration_history_sa (cod:=borel_sa) X n) borel_sa (g ∘ (make_vector_from_seq X (S n) )).
47404740
Proof.
47414741
rewrite filtrate_history_vector_equiv.
47424742
now apply pullback_compose_rv.

coq/QLearn/Tsitsiklis.v

+2-2
Original file line numberDiff line numberDiff line change
@@ -7436,7 +7436,7 @@ End FixedPoint_contract.
74367436
}
74377437
apply rv_vecrvnth; intros.
74387438
unfold vecrvnth.
7439-
eapply RandomVariable_proper; [reflexivity | reflexivity | ..].
7439+
eapply (RandomVariable_proper _ _ (reflexivity _) _ _ (reflexivity _)).
74407440
- intros ?.
74417441
unfold our_iso_f; simpl.
74427442
unfold finite_fun_to_vector.
@@ -7717,7 +7717,7 @@ End FixedPoint_contract.
77177717
intros.
77187718
typeclasses eauto.
77197719
}
7720-
eapply RandomVariable_proper; [reflexivity | reflexivity | ..].
7720+
eapply (RandomVariable_proper _ _ (reflexivity _) _ _ (reflexivity _)).
77217721
{
77227722
intros ?.
77237723
rewrite (FiniteExpectation_simple _ _).

0 commit comments

Comments
 (0)