Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Sophie Quinton
rtproofs
Commits
d3d75a3b
Commit
d3d75a3b
authored
Aug 09, 2016
by
Felipe Cerqueira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more lemmas about \max
parent
6461aa51
Changes
1
Show whitespace changes
Inline
Sidebyside
Showing
1 changed file
with
68 additions
and
0 deletions
+68
0
util/sum.v
util/sum.v
+68
0
No files found.
util/sum.v
View file @
d3d75a3b
...
...
@@ 94,6 +94,74 @@ Section ExtraLemmasSumMax.
by
destruct
(
m2
<
n2
)
eqn
:
LT
;
[
by
apply
/
orP
;
right

by
apply
/
orP
;
left
].
Qed
.
Lemma
bigmax_ord_ltn_identity
n
:
n
>
0
>
\
max_
(
i
<
n
)
i
<
n
.
Proof
.
intros
LT
.
destruct
n
;
first
by
rewrite
ltn0
in
LT
.
clear
LT
.
induction
n
;
first
by
rewrite
big_ord_recr
/=
big_ord0
maxn0
.
rewrite
big_ord_recr
/=.
unfold
maxn
at
1
;
desf
.
by
apply
leq_trans
with
(
n
:
=
n
.+
1
).
Qed
.
Lemma
bigmax_ltn_ord
n
(
P
:
pred
nat
)
(
i0
:
'
I_n
)
:
P
i0
>
\
max_
(
i
<
n

P
i
)
i
<
n
.
Proof
.
intros
LT
.
destruct
n
;
first
by
destruct
i0
as
[
i0
P0
]
;
move
:
(
P0
)
=>
P0'
;
rewrite
ltn0
in
P0'
.
rewrite
big_mkcond
.
apply
leq_ltn_trans
with
(
n
:
=
\
max_
(
i
<
n
.+
1
)
i
).
{
apply
/
bigmax_leqP
;
ins
.
destruct
(
P
i
)
;
last
by
done
.
by
apply
leq_bigmax_cond
.
}
by
apply
bigmax_ord_ltn_identity
.
Qed
.
Lemma
bigmax_pred
n
(
P
:
pred
nat
)
(
i0
:
'
I_n
)
:
P
(
i0
)
>
P
(
\
max_
(
i
<
n

P
i
)
i
).
Proof
.
intros
PRED
.
induction
n
.
{
destruct
i0
as
[
i0
P0
].
by
move
:
(
P0
)
=>
P1
;
rewrite
ltn0
in
P1
.
}
rewrite
big_mkcond
big_ord_recr
/=
;
desf
.
{
destruct
n
;
first
by
rewrite
big_ord0
maxn0
.
unfold
maxn
at
1
;
desf
.
exfalso
.
apply
negbT
in
Heq0
;
move
:
Heq0
=>
/
negP
BUG
.
apply
BUG
.
apply
leq_ltn_trans
with
(
n
:
=
\
max_
(
i
<
n
.+
1
)
i
).
{
apply
/
bigmax_leqP
;
ins
.
destruct
(
P
i
)
;
last
by
done
.
by
apply
leq_bigmax_cond
.
}
by
apply
bigmax_ord_ltn_identity
.
}
{
rewrite
maxn0
.
rewrite

big_mkcond
/=.
have
LT
:
i0
<
n
.
{
rewrite
ltn_neqAle
;
apply
/
andP
;
split
;
last
by
rewrite

ltnS
;
apply
ltn_ord
.
apply
/
negP
;
move
=>
/
eqP
BUG
.
by
rewrite

BUG
PRED
in
Heq
.
}
by
rewrite
(
IHn
(
Ordinal
LT
)).
}
Qed
.
Lemma
sum_nat_eq0_nat
(
T
:
eqType
)
(
F
:
T
>
nat
)
(
r
:
seq
T
)
:
all
(
fun
x
=>
F
x
==
0
)
r
=
(
\
sum_
(
i
<
r
)
F
i
==
0
).
Proof
.
...
...
Write
Preview
Markdown
is supported
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