Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
RefinedC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Iris
RefinedC
Commits
54eea69c
Commit
54eea69c
authored
4 years ago
by
Rodolphe Lepigre
Browse files
Options
Downloads
Patches
Plain Diff
Proving some remaining annoying lemmas.
parent
218c8d4b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#31908
passed
4 years ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/lang/base.v
+21
-1
21 additions, 1 deletion
theories/lang/base.v
with
21 additions
and
1 deletion
theories/lang/base.v
+
21
−
1
View file @
54eea69c
...
...
@@ -473,10 +473,30 @@ Proof. move => [? ->]. by rewrite /keep_factor2 factor2'_pow. Qed.
(* rewrite Z.mul_comm -Z.pow_succ_r; last by lia. f_equal. lia. *)
(* Qed. *)
Lemma
divide_mult_2
n1
n2
:
divide
2
(
n1
*
n2
)
→
divide
2
n1
∨
divide
2
n2
.
move
=>
/
Nat2Z_divide
.
rewrite
Nat2Z
.
inj_mul
.
move
=>
/
(
prime_mult
_
prime_2
)
.
move
=>
[
H
|
H
];
[
left
|
right
];
apply
Z2Nat_divide
in
H
;
try
lia
.
-
rewrite
Nat2Z
.
id
in
H
.
assert
(
Z
.
to_nat
2
=
2
)
as
Heq
by
lia
.
by
rewrite
Heq
in
H
.
-
rewrite
Nat2Z
.
id
in
H
.
assert
(
Z
.
to_nat
2
=
2
)
as
Heq
by
lia
.
by
rewrite
Heq
in
H
.
Qed
.
Lemma
is_power_of_two_mult
n1
n2
:
(
is_power_of_two
(
n1
*
n2
))
↔
(
is_power_of_two
n1
∧
is_power_of_two
n2
)
.
Proof
.
Admitted
.
rewrite
/
is_power_of_two
.
split
.
-
move
=>
[
m
Hm
]
.
move
:
n1
n2
Hm
.
elim
:
m
.
+
move
=>
/=
??
/
mult_is_one
[
->->
]
.
split
;
by
exists
0
.
+
move
=>
n
IH
n1
n2
H
.
rewrite
Nat
.
pow_succ_r'
in
H
.
assert
(
divide
2
(
n1
*
n2
))
as
Hdiv
.
{
exists
(
2
^
n
)
.
lia
.
}
apply
divide_mult_2
in
Hdiv
as
[[
k
->
]|[
k
->
]]
.
*
assert
(
k
*
n2
=
2
^
n
)
as
Hkn2
by
lia
.
apply
IH
in
Hkn2
as
[[
m
->
]
Hn2
]
.
split
=>
//.
exists
(
S
m
)
.
by
rewrite
mult_comm
-
Nat
.
pow_succ_r'
.
*
assert
(
n1
*
k
=
2
^
n
)
as
Hn1k
by
lia
.
apply
IH
in
Hn1k
as
[
Hn1
[
m
->
]]
.
split
=>
//.
exists
(
S
m
)
.
by
rewrite
mult_comm
-
Nat
.
pow_succ_r'
.
-
move
=>
[[
m1
->
]
[
m2
->
]]
.
exists
(
m1
+
m2
)
.
by
rewrite
Nat
.
pow_add_r
.
Qed
.
Lemma
if_bool_decide_eq_branches
{
A
}
P
`{
!
Decision
P
}
(
x
:
A
)
:
(
if
bool_decide
P
then
x
else
x
)
=
x
.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment