Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tej Chajed
stdpp
Commits
4201c413
Verified
Commit
4201c413
authored
Dec 05, 2021
by
Tej Chajed
Browse files
Avoid using Arith libraries deprecated in v8.16
parent
db60d211
Pipeline
#58393
passed with stage
in 12 minutes
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
tests/notation.v
View file @
4201c413
...
@@ -18,7 +18,7 @@ Section map_notations.
...
@@ -18,7 +18,7 @@ Section map_notations.
Definition
test_4
:
M
(
M
nat
)
:
=
{[
10
:
=
{[
10
:
=
1
]}
;
20
:
=
{[
20
:
=
2
]}
;
Definition
test_4
:
M
(
M
nat
)
:
=
{[
10
:
=
{[
10
:
=
1
]}
;
20
:
=
{[
20
:
=
2
]}
;
30
:
=
{[
30
:
=
3
]}
;
40
:
=
{[
40
:
=
4
]}
]}.
30
:
=
{[
30
:
=
3
]}
;
40
:
=
{[
40
:
=
4
]}
]}.
Definition
test_op_2
:
M
(
M
nat
)
:
=
{[
10
:
=
{[
pow
10
2
:
=
99
]}
;
Definition
test_op_2
:
M
(
M
nat
)
:
=
{[
10
:
=
{[
Nat
.
pow
10
2
:
=
99
]}
;
10
+
1
:
=
{[
10
-
100
:
=
42
*
1337
]}
]}.
10
+
1
:
=
{[
10
-
100
:
=
42
*
1337
]}
]}.
Definition
test_op_3
:
M
(
M
(
list
nat
))
:
=
{[
10
:
=
{[
20
-
2
:
=
[
11
]
;
1
:
=
[
22
]
]}
;
Definition
test_op_3
:
M
(
M
(
list
nat
))
:
=
{[
10
:
=
{[
20
-
2
:
=
[
11
]
;
1
:
=
[
22
]
]}
;
...
@@ -48,4 +48,4 @@ Section multiset_notations.
...
@@ -48,4 +48,4 @@ Section multiset_notations.
Print
test_gmultiset_2
.
Print
test_gmultiset_2
.
Print
test_gmultiset_3
.
Print
test_gmultiset_3
.
Print
test_gmultiset_4
.
Print
test_gmultiset_4
.
End
multiset_notations
.
End
multiset_notations
.
\ No newline at end of file
theories/fin_maps.v
View file @
4201c413
...
@@ -1156,7 +1156,7 @@ Lemma map_to_list_length {A} (m1 m2 : M A) :
...
@@ -1156,7 +1156,7 @@ Lemma map_to_list_length {A} (m1 m2 : M A) :
Proof
.
Proof
.
revert
m2
.
induction
m1
as
[|
i
x
m
?
IH
]
using
map_ind
.
revert
m2
.
induction
m1
as
[|
i
x
m
?
IH
]
using
map_ind
.
{
intros
m2
Hm2
.
rewrite
map_to_list_empty
.
simpl
.
{
intros
m2
Hm2
.
rewrite
map_to_list_empty
.
simpl
.
apply
neq_0_lt
.
intros
Hlen
.
symmetry
in
Hlen
.
apply
Nat
.
neq_0_lt
_0
,
Nat
.
neq_sym
.
intros
Hlen
.
symmetry
in
Hlen
.
apply
nil_length_inv
,
map_to_list_empty_iff
in
Hlen
.
apply
nil_length_inv
,
map_to_list_empty_iff
in
Hlen
.
rewrite
Hlen
in
Hm2
.
destruct
(
irreflexivity
(
⊂
)
∅
Hm2
).
}
rewrite
Hlen
in
Hm2
.
destruct
(
irreflexivity
(
⊂
)
∅
Hm2
).
}
intros
m2
Hm2
.
intros
m2
Hm2
.
...
...
theories/list.v
View file @
4201c413
...
@@ -1204,13 +1204,13 @@ Proof. revert n. induction l; intros [|?] ?; f_equal/=; auto with lia. Qed.
...
@@ -1204,13 +1204,13 @@ Proof. revert n. induction l; intros [|?] ?; f_equal/=; auto with lia. Qed.
Lemma
take_take
l
n
m
:
take
n
(
take
m
l
)
=
take
(
min
n
m
)
l
.
Lemma
take_take
l
n
m
:
take
n
(
take
m
l
)
=
take
(
min
n
m
)
l
.
Proof
.
revert
n
m
.
induction
l
;
intros
[|?]
[|?]
;
f_equal
/=
;
auto
.
Qed
.
Proof
.
revert
n
m
.
induction
l
;
intros
[|?]
[|?]
;
f_equal
/=
;
auto
.
Qed
.
Lemma
take_idemp
l
n
:
take
n
(
take
n
l
)
=
take
n
l
.
Lemma
take_idemp
l
n
:
take
n
(
take
n
l
)
=
take
n
l
.
Proof
.
by
rewrite
take_take
,
Min
.
min_id
empotent
.
Qed
.
Proof
.
by
rewrite
take_take
,
Nat
.
min_id
.
Qed
.
Lemma
take_length
l
n
:
length
(
take
n
l
)
=
min
n
(
length
l
).
Lemma
take_length
l
n
:
length
(
take
n
l
)
=
min
n
(
length
l
).
Proof
.
revert
n
.
induction
l
;
intros
[|?]
;
f_equal
/=
;
done
.
Qed
.
Proof
.
revert
n
.
induction
l
;
intros
[|?]
;
f_equal
/=
;
done
.
Qed
.
Lemma
take_length_le
l
n
:
n
≤
length
l
→
length
(
take
n
l
)
=
n
.
Lemma
take_length_le
l
n
:
n
≤
length
l
→
length
(
take
n
l
)
=
n
.
Proof
.
rewrite
take_length
.
apply
Min
.
min_l
.
Qed
.
Proof
.
rewrite
take_length
.
apply
Nat
.
min_l
.
Qed
.
Lemma
take_length_ge
l
n
:
length
l
≤
n
→
length
(
take
n
l
)
=
length
l
.
Lemma
take_length_ge
l
n
:
length
l
≤
n
→
length
(
take
n
l
)
=
length
l
.
Proof
.
rewrite
take_length
.
apply
Min
.
min_r
.
Qed
.
Proof
.
rewrite
take_length
.
apply
Nat
.
min_r
.
Qed
.
Lemma
take_drop_commute
l
n
m
:
take
n
(
drop
m
l
)
=
drop
m
(
take
(
m
+
n
)
l
).
Lemma
take_drop_commute
l
n
m
:
take
n
(
drop
m
l
)
=
drop
m
(
take
(
m
+
n
)
l
).
Proof
.
Proof
.
revert
n
m
.
induction
l
;
intros
[|?][|?]
;
simpl
;
auto
using
take_nil
with
lia
.
revert
n
m
.
induction
l
;
intros
[|?][|?]
;
simpl
;
auto
using
take_nil
with
lia
.
...
@@ -1483,9 +1483,9 @@ Proof.
...
@@ -1483,9 +1483,9 @@ Proof.
revert
n
m
.
induction
l
;
intros
[|?][|?]
;
f_equal
/=
;
auto
using
take_replicate
.
revert
n
m
.
induction
l
;
intros
[|?][|?]
;
f_equal
/=
;
auto
using
take_replicate
.
Qed
.
Qed
.
Lemma
take_resize_le
l
n
m
x
:
n
≤
m
→
take
n
(
resize
m
x
l
)
=
resize
n
x
l
.
Lemma
take_resize_le
l
n
m
x
:
n
≤
m
→
take
n
(
resize
m
x
l
)
=
resize
n
x
l
.
Proof
.
intros
.
by
rewrite
take_resize
,
Min
.
min_l
.
Qed
.
Proof
.
intros
.
by
rewrite
take_resize
,
Nat
.
min_l
.
Qed
.
Lemma
take_resize_eq
l
n
x
:
take
n
(
resize
n
x
l
)
=
resize
n
x
l
.
Lemma
take_resize_eq
l
n
x
:
take
n
(
resize
n
x
l
)
=
resize
n
x
l
.
Proof
.
intros
.
by
rewrite
take_resize
,
Min
.
min_l
.
Qed
.
Proof
.
intros
.
by
rewrite
take_resize
,
Nat
.
min_l
.
Qed
.
Lemma
take_resize_plus
l
n
m
x
:
take
n
(
resize
(
n
+
m
)
x
l
)
=
resize
n
x
l
.
Lemma
take_resize_plus
l
n
m
x
:
take
n
(
resize
(
n
+
m
)
x
l
)
=
resize
n
x
l
.
Proof
.
by
rewrite
take_resize
,
min_l
by
lia
.
Qed
.
Proof
.
by
rewrite
take_resize
,
min_l
by
lia
.
Qed
.
Lemma
drop_resize_le
l
n
m
x
:
Lemma
drop_resize_le
l
n
m
x
:
...
@@ -1699,7 +1699,7 @@ Proof.
...
@@ -1699,7 +1699,7 @@ Proof.
repeat
match
goal
with
repeat
match
goal
with
|
H
:
_
≤
length
_
|-
_
=>
rewrite
take_length
,
drop_length
in
H
|
H
:
_
≤
length
_
|-
_
=>
rewrite
take_length
,
drop_length
in
H
end
;
rewrite
?take_drop_commute
,
?drop_drop
,
?take_take
,
end
;
rewrite
?take_drop_commute
,
?drop_drop
,
?take_take
,
?
Min
.
min_l
,
Nat
.
add_assoc
by
lia
;
auto
with
lia
.
?
Nat
.
min_l
,
Nat
.
add_assoc
by
lia
;
auto
with
lia
.
Qed
.
Qed
.
Lemma
sublist_alter_length
f
l
i
n
k
:
Lemma
sublist_alter_length
f
l
i
n
k
:
sublist_lookup
i
n
l
=
Some
k
→
length
(
f
k
)
=
n
→
sublist_lookup
i
n
l
=
Some
k
→
length
(
f
k
)
=
n
→
...
@@ -3256,8 +3256,9 @@ Section Forall2.
...
@@ -3256,8 +3256,9 @@ Section Forall2.
{
rewrite
<-(
resize_resize
l
m
n
)
by
done
.
by
apply
Forall2_resize
.
}
{
rewrite
<-(
resize_resize
l
m
n
)
by
done
.
by
apply
Forall2_resize
.
}
intros
.
assert
(
n
=
length
k
)
;
subst
.
intros
.
assert
(
n
=
length
k
)
;
subst
.
{
by
rewrite
<-(
Forall2_length
(
resize
n
x
l
)
k
),
resize_length
.
}
{
by
rewrite
<-(
Forall2_length
(
resize
n
x
l
)
k
),
resize_length
.
}
rewrite
(
le_plus_minus
(
length
k
)
m
),
!
resize_plus
,
replace
m
with
(
length
k
+
(
m
-
length
k
))
by
lia
.
resize_all
,
drop_all
,
resize_nil
by
lia
.
rewrite
!
resize_plus
,
resize_all
,
drop_all
,
resize_nil
by
lia
.
auto
using
Forall2_app
,
Forall2_replicate_r
,
auto
using
Forall2_app
,
Forall2_replicate_r
,
Forall_resize
,
Forall_drop
,
resize_length
.
Forall_resize
,
Forall_drop
,
resize_length
.
Qed
.
Qed
.
...
@@ -3269,8 +3270,9 @@ Section Forall2.
...
@@ -3269,8 +3270,9 @@ Section Forall2.
{
rewrite
<-(
resize_resize
k
m
n
)
by
done
.
by
apply
Forall2_resize
.
}
{
rewrite
<-(
resize_resize
k
m
n
)
by
done
.
by
apply
Forall2_resize
.
}
assert
(
n
=
length
l
)
;
subst
.
assert
(
n
=
length
l
)
;
subst
.
{
by
rewrite
(
Forall2_length
l
(
resize
n
y
k
)),
resize_length
.
}
{
by
rewrite
(
Forall2_length
l
(
resize
n
y
k
)),
resize_length
.
}
rewrite
(
le_plus_minus
(
length
l
)
m
),
!
resize_plus
,
replace
m
with
(
length
l
+
(
m
-
length
l
))
by
lia
.
resize_all
,
drop_all
,
resize_nil
by
lia
.
rewrite
!
resize_plus
,
resize_all
,
drop_all
,
resize_nil
by
lia
.
auto
using
Forall2_app
,
Forall2_replicate_l
,
auto
using
Forall2_app
,
Forall2_replicate_l
,
Forall_resize
,
Forall_drop
,
resize_length
.
Forall_resize
,
Forall_drop
,
resize_length
.
Qed
.
Qed
.
...
@@ -3318,7 +3320,7 @@ Section Forall2.
...
@@ -3318,7 +3320,7 @@ Section Forall2.
apply
Forall2_app_l
;
apply
Forall2_app_l
;
rewrite
?take_length_le
by
lia
;
auto
using
Forall2_take
.
rewrite
?take_length_le
by
lia
;
auto
using
Forall2_take
.
apply
Forall2_app_l
;
erewrite
Forall2_length
,
take_length
,
apply
Forall2_app_l
;
erewrite
Forall2_length
,
take_length
,
drop_length
,
<-
Forall2_length
,
Min
.
min_l
by
eauto
with
lia
;
[
done
|].
drop_length
,
<-
Forall2_length
,
Nat
.
min_l
by
eauto
with
lia
;
[
done
|].
rewrite
drop_drop
;
auto
using
Forall2_drop
.
rewrite
drop_drop
;
auto
using
Forall2_drop
.
Qed
.
Qed
.
...
@@ -3652,7 +3654,8 @@ Section find.
...
@@ -3652,7 +3654,8 @@ Section find.
naive_solver
eauto
using
lookup_app_l_Some
with
lia
.
}
naive_solver
eauto
using
lookup_app_l_Some
with
lia
.
}
apply
list_find_Some
.
split_and
!
;
[
done
..|].
apply
list_find_Some
.
split_and
!
;
[
done
..|].
intros
j
z
??.
eapply
(
Hleast
(
length
l1
+
j
))
;
[|
lia
].
intros
j
z
??.
eapply
(
Hleast
(
length
l1
+
j
))
;
[|
lia
].
by
rewrite
lookup_app_r
,
minus_plus
by
lia
.
rewrite
lookup_app_r
by
lia
.
by
replace
(
length
l1
+
j
-
length
l1
)
with
j
by
lia
.
-
intros
[(?&?&
Hleast
)%
list_find_Some
|(?&
Hl1
&(?&?&
Hleast
)%
list_find_Some
)].
-
intros
[(?&?&
Hleast
)%
list_find_Some
|(?&
Hl1
&(?&?&
Hleast
)%
list_find_Some
)].
+
apply
list_find_Some
.
split_and
!
;
[
by
auto
using
lookup_app_l_Some
..|].
+
apply
list_find_Some
.
split_and
!
;
[
by
auto
using
lookup_app_l_Some
..|].
assert
(
i
<
length
l1
)
by
eauto
using
lookup_lt_Some
.
assert
(
i
<
length
l1
)
by
eauto
using
lookup_lt_Some
.
...
...
theories/numbers.v
View file @
4201c413
...
@@ -1371,7 +1371,7 @@ Lemma rotate_nat_add_add base offset len n:
...
@@ -1371,7 +1371,7 @@ Lemma rotate_nat_add_add base offset len n:
Proof
.
Proof
.
intros
?.
unfold
rotate_nat_add
.
intros
?.
unfold
rotate_nat_add
.
rewrite
!
Z2Nat_inj_mod
,
!
Z2Nat
.
inj_add
,
!
Nat2Z
.
id
by
lia
.
rewrite
!
Z2Nat_inj_mod
,
!
Z2Nat
.
inj_add
,
!
Nat2Z
.
id
by
lia
.
by
rewrite
plus
_assoc
,
Nat
.
add_mod_idemp_l
by
lia
.
by
rewrite
Nat
.
add
_assoc
,
Nat
.
add_mod_idemp_l
by
lia
.
Qed
.
Qed
.
Lemma
rotate_nat_add_S
base
offset
len
:
Lemma
rotate_nat_add_S
base
offset
len
:
...
...
theories/relations.v
View file @
4201c413
...
@@ -177,7 +177,7 @@ Section general.
...
@@ -177,7 +177,7 @@ Section general.
Lemma
bsteps_weaken
n
m
x
y
:
Lemma
bsteps_weaken
n
m
x
y
:
n
≤
m
→
bsteps
R
n
x
y
→
bsteps
R
m
x
y
.
n
≤
m
→
bsteps
R
n
x
y
→
bsteps
R
m
x
y
.
Proof
.
Proof
.
intros
.
rew
r
it
e
(
Minus
.
le_plus_minus
n
m
)
;
auto
using
bsteps_plus_r
.
intros
.
re
place
m
wit
h
(
n
+
(
m
-
n
))
by
lia
;
auto
using
bsteps_plus_r
.
Qed
.
Qed
.
Lemma
bsteps_plus_l
n
m
x
y
:
Lemma
bsteps_plus_l
n
m
x
y
:
bsteps
R
n
x
y
→
bsteps
R
(
m
+
n
)
x
y
.
bsteps
R
n
x
y
→
bsteps
R
(
m
+
n
)
x
y
.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment