Built with Alectryon, running Coq+SerAPI v8.13.0+0.13.0. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑ Ctrl+↓ to navigate, Ctrl+🖱️ to focus. On Mac, use instead of Ctrl.
Notation "[ rel _ _ | _ ]" was already used in scope fun_scope. [notation-overridden,parsing]
Notation "[ rel _ _ : _ | _ ]" was already used in scope fun_scope. [notation-overridden,parsing]
Notation "[ rel _ _ in _ & _ | _ ]" was already used in scope fun_scope. [notation-overridden,parsing]
Notation "[ rel _ _ in _ & _ ]" was already used in scope fun_scope. [notation-overridden,parsing]
Notation "[ rel _ _ in _ | _ ]" was already used in scope fun_scope. [notation-overridden,parsing]
Notation "[ rel _ _ in _ ]" was already used in scope fun_scope. [notation-overridden,parsing]
Notation "_ + _" was already used in scope nat_scope. [notation-overridden,parsing]
Notation "_ - _" was already used in scope nat_scope. [notation-overridden,parsing]
Notation "_ <= _" was already used in scope nat_scope. [notation-overridden,parsing]
Notation "_ < _" was already used in scope nat_scope. [notation-overridden,parsing]
Notation "_ >= _" was already used in scope nat_scope. [notation-overridden,parsing]
Notation "_ > _" was already used in scope nat_scope. [notation-overridden,parsing]
Notation "_ <= _ <= _" was already used in scope nat_scope. [notation-overridden,parsing]
Notation "_ < _ <= _" was already used in scope nat_scope. [notation-overridden,parsing]
Notation "_ <= _ < _" was already used in scope nat_scope. [notation-overridden,parsing]
Notation "_ < _ < _" was already used in scope nat_scope. [notation-overridden,parsing]
Notation "_ * _" was already used in scope nat_scope. [notation-overridden,parsing]
From hanoi Require Import extra. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Section Main. Variable a b : nat. Hypothesis aL1 : 1 < a. Hypothesis aLb : a < b. Hypothesis aCb : coprime a b.
a, b:nat
aL1:1 < a
aLb:a < b
aCb:coprime a b

1 < b
2
by apply: ltn_trans aLb. Qed. Fixpoint alphal (n : nat) := if n isn't n1.+1 then [:: 1; a; b] else let l := alphal n1 in merge leq (let c := head 1 l in let l1 := if b * c \in l then [::] else [:: b * c] in if a * c \in l then l1 else a * c :: l1) (behead l). Definition alpha n := head 1 (alphal n).
5678
bL1:1 < b
T:eqType
r:rel T
l:seq T

sorted r l -> sorted r (behead l)
c
by case: l => //= a1 [|b1 l /andP[]]. Qed.
5678f
n:nat

sorted leq (alphal n)
16
5678f19
IH:sorted leq (alphal n)

sorted leq (merge leq (if a * head 1 (alphal n) \in alphal n then if b * head 1 (alphal n) \in alphal n then [::] else [:: b * head 1 (alphal n)] else a * head 1 (alphal n) :: (if b * head 1 (alphal n) \in alphal n then [::] else [:: b * head 1 (alphal n)])) (behead (alphal n)))
1f
sorted leq (if a * head 1 (alphal n) \in alphal n then if b * head 1 (alphal n) \in alphal n then [::] else [:: b * head 1 (alphal n)] else a * head 1 (alphal n) :: (if b * head 1 (alphal n) \in alphal n then [::] else [:: b * head 1 (alphal n)]))
1f
sorted leq (behead (alphal n))
1f
28
by apply: behead_sorted. Qed.
5678f19
i:nat_eqType

i \in alphal n -> 0 < i
2d
5678f
i:nat

i \in [:: 1; a; b] -> 0 < i
18
(forall i : nat, i \in alphal n -> 0 < i) -> forall i : nat, i \in merge leq (if a * head 1 (alphal n) \in alphal n then if b * head 1 (alphal n) \in alphal n then [::] else [:: b * head 1 (alphal n)] else a * head 1 (alphal n) :: (if b * head 1 (alphal n) \in alphal n then [::] else [:: b * head 1 (alphal n)])) (behead (alphal n)) -> 0 < i
18
3b
5678f
n, i:nat

(i == a * 1) || (i == b * 1) -> 0 < i
5678f
n, a1:nat
l:seq nat
IH:forall i : nat, i \in a1 :: l -> 0 < i
37
i \in merge leq (if (a * a1 == a1) || (a * a1 \in l) then if (b * a1 == a1) || (b * a1 \in l) then [::] else [:: b * a1] else a * a1 :: (if (b * a1 == a1) || (b * a1 \in l) then [::] else [:: b * a1])) l -> 0 < i
47
4b
5678f48494a37
H1:0 < a1

4b
5678f48494a3753
i1:nat_eqType

i1 \in l -> 0 < i1
5678f48494a3753
IH1:forall i1 : nat_eqType, i1 \in l -> 0 < i1
4b
5c
4b
5c
i \in (if (a * a1 == a1) || (a * a1 \in l) then if (b * a1 == a1) || (b * a1 \in l) then [::] else [:: b * a1] else a * a1 :: (if (b * a1 == a1) || (b * a1 \in l) then [::] else [:: b * a1])) ++ l -> 0 < i
5c
(i == b * a1) || (i \in l) -> 0 < i
5c
(i == a * a1) || (i \in l) -> 0 < i
5c
[|| i == a * a1, i == b * a1 | i \in l] -> 0 < i
66
5c
6b
6c
70
5c
6d
by case/or3P=> [/eqP->|/eqP->|/IH1//]; rewrite muln_gt0 ltnW. Qed.
18
alphal n != [::]
78
18
merge leq (if a * head 1 (alphal n) \in alphal n then if b * head 1 (alphal n) \in alphal n then [::] else [:: b * head 1 (alphal n)] else a * head 1 (alphal n) :: (if b * head 1 (alphal n) \in alphal n then [::] else [:: b * head 1 (alphal n)])) (behead (alphal n)) != [::]
18
size ((if a * head 1 (alphal n) \in alphal n then if b * head 1 (alphal n) \in alphal n then [::] else [:: b * head 1 (alphal n)] else a * head 1 (alphal n) :: (if b * head 1 (alphal n) \in alphal n then [::] else [:: b * head 1 (alphal n)])) ++ behead (alphal n)) != 0
5678f
n, c:nat
49
H:forall i : nat, i \in c :: l -> 0 < i

size ((if a * c \in c :: l then if b * c \in c :: l then [::] else [:: b * c] else a * c :: (if b * c \in c :: l then [::] else [:: b * c])) ++ l) != 0
5678f884989
E:(a * c \in c :: l) = true

size ([::] ++ l) != 0
5678f88

0 < c -> (a * c == c) = true -> 1 < a -> size ([::] ++ [::]) != 0
5678f
n, c1:nat

(a * c1.+1 == c1.+1) = true -> 1 < a -> size ([::] ++ [::]) != 0
by rewrite -{2}[_.+1]mul1n eqn_mul2r /= => /idP/eqP->. Qed.
18
uniq (alphal n)
9d
5678f

[&& 1 \notin [:: a; b], a \notin [:: b] & true]
5678f19
IH:uniq (alphal n)
uniq (merge leq (if a * head 1 (alphal n) \in alphal n then if b * head 1 (alphal n) \in alphal n then [::] else [:: b * head 1 (alphal n)] else a * head 1 (alphal n) :: (if b * head 1 (alphal n) \in alphal n then [::] else [:: b * head 1 (alphal n)])) (behead (alphal n)))
a8
aa
18
(a * 1 \notin [:: b * 1]) && true
5678f8849
U:forall i : nat, i \in c :: l -> 0 < i
cL:c \notin l
uL:uniq l
uniq (merge leq (if a * c \in c :: l then if b * c \in c :: l then [::] else [:: b * c] else a * c :: (if b * c \in c :: l then [::] else [:: b * c])) l)
b4
b8
5678f8849b5b6b7
H1:a * c \in c :: l
H2:b * c \notin c :: l

b * c \notin l
5678f8849b5b6b7
H1:a * c \notin c :: l
H2:b * c \in c :: l
a * c \notin l
5678f8849b5b6b7c6c1
(a * c \notin b * c :: l) && (b * c \notin l)
bd
c5
c8
c9
ce
ca
cb
b4
(a * c != b * c) && true && true
by rewrite eqn_mul2r negb_or !neq_ltn aLb U ?orbT // inE eqxx. Qed.
18
alpha n < alpha n.+1
da
18
head 1 (alphal n) < head 1 (merge leq (if a * head 1 (alphal n) \in alphal n then if b * head 1 (alphal n) \in alphal n then [::] else [:: b * head 1 (alphal n)] else a * head 1 (alphal n) :: (if b * head 1 (alphal n) \in alphal n then [::] else [:: b * head 1 (alphal n)])) (behead (alphal n)))
5678f19
h:=head 1 (alphal n):nat

h < head 1 (merge leq (if a * h \in alphal n then if b * h \in alphal n then [::] else [:: b * h] else a * h :: (if b * h \in alphal n then [::] else [:: b * h])) (behead (alphal n)))
e5
0 < h
5678f19e6
hP:0 < h
e7
e5
0 < head 1 (alphal n)
ec
5678f19e6
c:nat
49

c \in c :: l
ec
ee
e7
5678f19e6ef
l1:=merge leq (if a * h \in alphal n then if b * h \in alphal n then [::] else [:: b * h] else a * h :: (if b * h \in alphal n then [::] else [:: b * h])) (behead (alphal n)):seq nat

h < head 1 l1
100
head 1 l1 \in l1
5678f19e6ef101
hIl1:head 1 l1 \in l1
102
100
merge leq (if a * head 1 (alphal n) \in alphal n then if b * head 1 (alphal n) \in alphal n then [::] else [:: b * head 1 (alphal n)] else a * head 1 (alphal n) :: (if b * head 1 (alphal n) \in alphal n then [::] else [:: b * head 1 (alphal n)])) (behead (alphal n)) != [::] -> head 1 l1 \in l1
107
109
102
5678f19e6ef10110a
hLi:forall i : nat_eqType, i \in l1 -> h < i

102
5678f19e6ef
l1:=merge leq (if a * h \in alphal n then if b * h \in alphal n then [::] else [:: b * h] else a * h :: (if b * h \in alphal n then [::] else [:: b * h])) (behead (alphal n)):seq nat
10a30
i \in l1 -> h < i
5678f19e6ef10110a30

11b
11f
(i \in (if a * h \in alphal n then if b * h \in alphal n then [::] else [:: b * h] else a * h :: (if b * h \in alphal n then [::] else [:: b * h]))) || (i \in behead (alphal n)) -> h < i
5678f19e6ef10110a30
hLi1:i \in behead (alphal n) -> h < i

123
5678f19e6ef11a10a30
H:i \in behead (alphal n)
h < i
5678f19e6ef10110a30128
H1:a * h \in alphal n
H2:b * h \notin alphal n

(i == b * h) || (i \in behead (alphal n)) -> h < i
5678f19e6ef11a10a30128
H1:a * h \notin alphal n
H2:b * h \in alphal n
(i == a * h) || (i \in behead (alphal n)) -> h < i
5678f19e6ef11a10a30128138133
(i == a * h) || (i == b * h) || (i \in behead (alphal n)) -> h < i
12a
12f
5678f19e6ef10110a30128138139

13a
13b12a
140
5678f19e6ef10110a30128138133

(i == a * h) || (i == b * h) || (i \in behead (alphal n)) -> h < i
129
5678f19e6ef10110a3012c

12d
14d
subseq [:: h; i] (alphal n)
5678f19e6ef11a10a3012c
hsSa:subseq [:: h; i] (alphal n)
12d
14d
subseq [:: h; i] (h :: behead (alphal n))
12b
alphal n = h :: behead (alphal n)
153
14d
subseq [:: i] (behead (alphal n))
15a
14d
15c
152
5678f19e6ef10110a3012c155

12d
167
(h != i) && (h <= i)
167
(h <= i) && true -> (h != i) && (h <= i)
167
(h != i) && true
167
(h \notin [:: i]) && true -> (h != i) && true
by rewrite inE. Qed.
5678f
m, n:nat

m < n -> alpha m < alpha n
179
5678f17c
IH:m < n -> alpha m < alpha n

m < n.+1 -> alpha m < alpha n.+1
5678f17c183
F:alpha n < alpha n.+1

184
by rewrite ltnS leq_eqVlt => /orP[/eqP->| /IH /ltn_trans-> //]. Qed.
a4
injective alpha
18b
5678f17c
amEan:alpha m = alpha n

m == n
by case: ltngtP => // /alpha_mono; rewrite amEan ltnn. Qed.
18
0 < alpha n
196
by case: n => // n; apply: leq_ltn_trans (alpha_ltn _). Qed.
18
n < alpha n
19b
by elim: n => // n IH; apply: leq_trans (alpha_ltn _). Qed. Definition isAB i := exists m, i = a ^ m.1 * b ^ m.2.
36
isAB (a ^ i)
1a0
by exists (i, 0); rewrite muln1. Qed.
36
isAB (b ^ i)
1a5
by exists (0, i); rewrite mul1n. Qed.
36
isAB i -> isAB (a * i)
1aa
5678f
i, m1, m2:nat

a * (a ^ m1 * b ^ m2) = a ^ (m1.+1, m2).1 * b ^ (m1.+1, m2).2
by rewrite !mulnA expnS. Qed.
36
isAB i -> isAB (b * i)
1b5
1b1
b * (a ^ m1 * b ^ m2) = a ^ (m1, m2.+1).1 * b ^ (m1, m2.+1).2
by rewrite mulnCA expnS. Qed.
2f
i \in alphal n -> isAB i
1be
36
[|| i == 1, i == a | i == b] -> isAB i
5678f19
IH:forall i : nat, i \in alphal n -> isAB i
37
i \in (if a * head 1 (alphal n) \in alphal n then if b * head 1 (alphal n) \in alphal n then [::] else [:: b * head 1 (alphal n)] else a * head 1 (alphal n) :: (if b * head 1 (alphal n) \in alphal n then [::] else [:: b * head 1 (alphal n)])) ++ behead (alphal n) -> isAB i
36
isAB a
36
isAB b
1c7
36
1d1
1c6
1c8
1ca
1c8
i \in behead (alphal n) -> exists m : nat * nat, i = a ^ m.1 * b ^ m.2
5678f191c937
F:i \in behead (alphal n) -> exists m : nat * nat, i = a ^ m.1 * b ^ m.2
1ca
1de
1ca
1de
exists m : nat * nat, head 1 (alphal n) = a ^ m.1 * b ^ m.2
5678f191c9371df
m1, m2:nat
Hm:head 1 (alphal n) = a ^ (m1, m2).1 * b ^ (m1, m2).2
1ca
5678f431dff849
F1:forall i : nat, i \in c :: l -> isAB i

exists m : nat * nat, c = a ^ m.1 * b ^ m.2
1e7
1e9
1ca
1e9
i \in behead (alphal n) -> isAB i
1e9
(i == b * head 1 (alphal n)) || (i \in behead (alphal n)) -> isAB i
1e9
(i == a * head 1 (alphal n)) || (i \in behead (alphal n)) -> isAB i
1e9
[|| i == a * head 1 (alphal n), i == b * head 1 (alphal n) | i \in behead (alphal n)] -> isAB i
1f6
1e9
1fb
1fc1fe
202
202
1e9
b * head 1 (alphal n) = a ^ (m1, m2.+1).1 * b ^ (m1, m2.+1).2
204
1e9
1fd
1fe
20c
1e9
a * head 1 (alphal n) = a ^ (m1.+1, m2).1 * b ^ (m1.+1, m2).2
20e
1e9
1ff
1e9
isAB (a * head 1 (alphal n))
1e9
isAB (b * head 1 (alphal n))
1e9
21d
by exists (m1, m2.+1); rewrite /= Hm mulnCA expnS. Qed.
18
isAB (alpha n)
222
18
isAB (head 1 (alphal n))
5678f8849

(c \in c :: l -> isAB c) -> isAB c
by apply; rewrite inE eqxx. Qed.
2f
i \in alphal n -> i != alpha n -> i \in alphal n.+1
230
2f
0 < alpha n -> i \in alphal n -> i != alpha n -> i \in alphal n.+1
2f
0 < head 1 (alphal n) -> i \in alphal n -> i != head 1 (alphal n) -> (i \in behead (alphal n)) || (i \in (if a * head 1 (alphal n) \in alphal n then if b * head 1 (alphal n) \in alphal n then [::] else [:: b * head 1 (alphal n)] else a * head 1 (alphal n) :: (if b * head 1 (alphal n) \in alphal n then [::] else [:: b * head 1 (alphal n)])))
5678f1930f849
cP:0 < c

i \in c :: l -> i != c -> (i \in l) || (i \in (if a * c \in c :: l then if b * c \in c :: l then [::] else [:: b * c] else a * c :: (if b * c \in c :: l then [::] else [:: b * c])))
by rewrite inE => /orP[/eqP->|->//]; rewrite eqxx. Qed.
18
alpha n \in alphal n
243
18
alphal n != [::] -> alpha n \in alphal n
22d
true -> c \in c :: l
by rewrite inE eqxx. Qed.
2f
i \in alphal n.+1 -> i != a * alpha n -> i != b * alpha n -> i \in alphal n
250
2f
i \in merge leq (if a * head 1 (alphal n) \in alphal n then if b * head 1 (alphal n) \in alphal n then [::] else [:: b * head 1 (alphal n)] else a * head 1 (alphal n) :: (if b * head 1 (alphal n) \in alphal n then [::] else [:: b * head 1 (alphal n)])) (behead (alphal n)) -> i != a * head 1 (alphal n) -> i != b * head 1 (alphal n) -> i \in alphal n
5678f1930e6

i \in merge leq (if a * h \in alphal n then if b * h \in alphal n then [::] else [:: b * h] else a * h :: (if b * h \in alphal n then [::] else [:: b * h])) (behead (alphal n)) -> i != a * h -> i != b * h -> i \in alphal n
25b
i \in behead (alphal n) -> i != a * h -> i != b * h -> i \in alphal n
25b
i \in (if a * h \in alphal n then if b * h \in alphal n then [::] else [:: b * h] else a * h :: (if b * h \in alphal n then [::] else [:: b * h])) -> i != a * h -> i != b * h -> i \in alphal n
25b
263
by (do 2 case: (_ \in alphal _); rewrite //= ?inE) => [/eqP->|/eqP->|/orP[/eqP->|/eqP->]]; rewrite eqxx. Qed.
18
a * alpha n \in alphal n.+1
268
18
0 < alpha n -> a * alpha n \in alphal n.+1
18
(a * alpha n \in alphal n -> a * alpha n != alpha n -> a * alpha n \in alphal n.+1) -> 0 < alpha n -> a * alpha n \in alphal n.+1
18
(a * head 1 (alphal n) \in alphal n -> a * head 1 (alphal n) != head 1 (alphal n) -> a * head 1 (alphal n) \in (if a * head 1 (alphal n) \in alphal n then if b * head 1 (alphal n) \in alphal n then [::] else [:: b * head 1 (alphal n)] else a * head 1 (alphal n) :: (if b * head 1 (alphal n) \in alphal n then [::] else [:: b * head 1 (alphal n)])) ++ behead (alphal n)) -> 0 < head 1 (alphal n) -> a * head 1 (alphal n) \in (if a * head 1 (alphal n) \in alphal n then if b * head 1 (alphal n) \in alphal n then [::] else [:: b * head 1 (alphal n)] else a * head 1 (alphal n) :: (if b * head 1 (alphal n) \in alphal n then [::] else [:: b * head 1 (alphal n)])) ++ behead (alphal n)
e5
(a * h \in alphal n -> a * h != h -> a * h \in (if a * h \in alphal n then if b * h \in alphal n then [::] else [:: b * h] else a * h :: (if b * h \in alphal n then [::] else [:: b * h])) ++ behead (alphal n)) -> 0 < h -> a * h \in (if a * h \in alphal n then if b * h \in alphal n then [::] else [:: b * h] else a * h :: (if b * h \in alphal n then [::] else [:: b * h])) ++ behead (alphal n)
5678f19e6
H:a * h \in alphal n
H1:true -> a * h != h -> a * h \in (if b * h \in alphal n then [::] else [:: b * h]) ++ behead (alphal n)
H2:0 < h

a * h \in (if b * h \in alphal n then [::] else [:: b * h]) ++ behead (alphal n)
e5
a * h \notin alphal n -> (false -> a * h != h -> a * h \in (a * h :: (if b * h \in alphal n then [::] else [:: b * h])) ++ behead (alphal n)) -> 0 < h -> a * h \in (a * h :: (if b * h \in alphal n then [::] else [:: b * h])) ++ behead (alphal n)
5678f19e6280282

a * h != h
284
e5
286
by rewrite mem_cat inE eqxx. Qed.
18
b * alpha n \in alphal n.+1
290
18
0 < alpha n -> b * alpha n \in alphal n.+1
18
(b * alpha n \in alphal n -> b * alpha n != alpha n -> b * alpha n \in alphal n.+1) -> 0 < alpha n -> b * alpha n \in alphal n.+1
18
(b * head 1 (alphal n) \in alphal n -> b * head 1 (alphal n) != head 1 (alphal n) -> b * head 1 (alphal n) \in (if a * head 1 (alphal n) \in alphal n then if b * head 1 (alphal n) \in alphal n then [::] else [:: b * head 1 (alphal n)] else a * head 1 (alphal n) :: (if b * head 1 (alphal n) \in alphal n then [::] else [:: b * head 1 (alphal n)])) ++ behead (alphal n)) -> 0 < head 1 (alphal n) -> b * head 1 (alphal n) \in (if a * head 1 (alphal n) \in alphal n then if b * head 1 (alphal n) \in alphal n then [::] else [:: b * head 1 (alphal n)] else a * head 1 (alphal n) :: (if b * head 1 (alphal n) \in alphal n then [::] else [:: b * head 1 (alphal n)])) ++ behead (alphal n)
e5
(b * h \in alphal n -> b * h != h -> b * h \in (if a * h \in alphal n then if b * h \in alphal n then [::] else [:: b * h] else a * h :: (if b * h \in alphal n then [::] else [:: b * h])) ++ behead (alphal n)) -> 0 < h -> b * h \in (if a * h \in alphal n then if b * h \in alphal n then [::] else [:: b * h] else a * h :: (if b * h \in alphal n then [::] else [:: b * h])) ++ behead (alphal n)
5678f19e6
H:b * h \in alphal n
H1:true -> b * h != h -> b * h \in (if a * h \in alphal n then [::] else [:: a * h]) ++ behead (alphal n)
282

b * h \in (if a * h \in alphal n then [::] else [:: a * h]) ++ behead (alphal n)
e5
b * h \notin alphal n -> (false -> b * h != h -> b * h \in (if a * h \in alphal n then [:: b * h] else [:: a * h; b * h]) ++ behead (alphal n)) -> 0 < h -> b * h \in (if a * h \in alphal n then [:: b * h] else [:: a * h; b * h]) ++ behead (alphal n)
5678f19e62a8282

b * h != h
2ab
e5
2ad
by have [] := boolP (a * _ \in alphal n); rewrite mem_cat !inE eqxx // orbT. Qed.
17b
{k : nat | alpha k = a ^ m * b ^ n}
2b7
5678f17c
P:=fun p : nat => has (dvdn^~ (a ^ m * b ^ n)) (alphal p):nat -> bool

2b9
2be
exists n : nat, P n
5678f17c2bf
F1:exists n : nat, P n
2b9
2c6
2b9
2c6
0 < a ^ m * b ^ n
5678f17c2bf2c7
F2:0 < a ^ m * b ^ n
2b9
2d1
2b9
5678f17c2bf2c72d2
p:nat

P p -> p <= alpha (a ^ m * b ^ n)
5678f17c2bf2c72d2
F3:forall p : nat, P p -> p <= alpha (a ^ m * b ^ n)
2b9
5678f17c2bf2c72d22da
q:nat_eqType
qIa:q \in alphal p

q %| a ^ m * b ^ n -> p <= alpha (a ^ m * b ^ n)
2dc
5678f17c2bf2c72d22da2e42e5
F:alpha p <= q

2e6
2e3
alpha p <= q
2dd
5678f17c2bf2c72d22da2e42e52eb
H:q <= a ^ m * b ^ n

p <= alpha (a ^ m * b ^ n)
2ec
2f2
alpha p <= alpha (a ^ m * b ^ n)
2ec
2e3
2ee
2dc
2e3
sorted leq (alphal p) -> head 1 (alphal p) <= q
2dc
5678f17c2bf2c72d22da2e4
a1:nat
49

q \in a1 :: l -> path leq a1 l -> a1 <= q
2dc
2de
2b9
2de
alpha (ex_maxn F1 F3) = a ^ m * b ^ n
5678f17c2bf2c72d22df37
x:nat_eqType
xIa:x \in alphal i
Hx:x %| a ^ m * b ^ n
Fx:forall j : nat, P j -> j <= i

alpha i = a ^ m * b ^ n
310
~~ P i.+1 -> alpha i = a ^ m * b ^ n
5678f17c2bf2c72d22df37311312313314
FF:{in alphal i.+1, forall x : nat_eqType, ~~ (x %| a ^ m * b ^ n)}

315
31d
x = alpha i
5678f17c2bf2c72d22df3731131231331431e
F4:x = alpha i
315
325
315
5678f17c2bf2c72d22df3731131231331431e326
m1, n1:nat
F5:alpha i = a ^ (m1, n1).1 * b ^ (m1, n1).2

315
5678f17c2bf2c72d22df3731131231331431e32632e32f
m2, n2:nat

coprime (a ^ m2) (b ^ n2)
5678f17c2bf2c72d22df3731131231331431e32632e32f
Cabe:forall m2 n2 : nat, coprime (a ^ m2) (b ^ n2)
315
5678f17c2bf2c72d22df3731131231331431e32632e32f
n2, m2:nat

coprime (a ^ m2.+1) (b ^ n2)
336
333
coprime (a ^ m2.+1) (b ^ n2.+1)
336
338
315
5678f17c2bf2c72d22df3731131231431e32632e32f339

x %| a ^ m * b ^ n -> alpha i = a ^ m * b ^ n
34a
(a ^ m1 %| a ^ m * b ^ n) && (b ^ n1 %| a ^ m * b ^ n) -> a ^ m1 * b ^ n1 = a ^ m * b ^ n
34a
(a ^ m1 %| a ^ m) && (b ^ n1 %| b ^ n) -> a ^ m1 * b ^ n1 = a ^ m * b ^ n
34a
(m1 <= m) && (n1 <= n) -> a ^ m1 * b ^ n1 = a ^ m * b ^ n
5678f17c2bf2c72d22df3731131231431e32632e32f339
H1:m1 < m
H2:n1 <= n

a ^ m1 * b ^ n1 = a ^ m * b ^ n
5678f17c2bf2c72d22df3731131231431e32632e32f339
mEm1:m1 = m
n1 <= n -> a ^ m1 * b ^ n1 = a ^ m * b ^ n
35b
a * alpha i %| a ^ m * b ^ n
35f
35b
a ^ m1.+1 * b ^ n1 %| a ^ m * b ^ n
35f
361
363
5678f17c2bf2c72d22df3731131231431e32632e32f339362
H1:n1 < n

35e
372
b * alpha i %| a ^ m * b ^ n
372
a ^ m * b ^ n1.+1 %| a ^ m * b ^ n
by apply: dvdn_mul; apply: dvdn_exp2l. Qed.
5678f
i, v:nat

isAB v -> alpha i < v -> alpha i.+1 <= v
37d
5678f
i, v, m1, m2:nat

alpha i < a ^ (m1, m2).1 * b ^ (m1, m2).2 -> alpha i.+1 <= a ^ (m1, m2).1 * b ^ (m1, m2).2
5678f
i, v, m1, m2, j:nat
iLj:alpha i < alpha j

alpha i.+1 <= alpha j
38c
i < j -> alpha i.+1 <= alpha j
5678f38d38e
H:j < i.+1
38f
396
38f
5678f38d

j < i.+1 -> ~~ (alpha j <= alpha i) -> alpha i.+1 <= alpha j
39e
~~ (alpha i <= alpha i) -> alpha i.+1 <= alpha i
by rewrite leqnn. Qed.
36
alpha i.+1 <= a * alpha i
3a5
36
alpha i < a * alpha i
by rewrite -[X in X < _]mul1n ltn_mul2r alpha_gt0. Qed.
37f
isAB v -> v < alpha i.+1 -> v <= alpha i
3ae
5678f380
isAB:Main.isAB v

(alpha i < v -> alpha i.+1 <= v) -> v < alpha i.+1 -> v <= alpha i
by do 2 case: leqP => // _. Qed.
42
i <= n -> \sum_(j < n) alpha j <= a * (\sum_(j < n - i) alpha j) + \sum_(j < i) b ^ j
3b9
5678f43
iLn:i <= n

\sum_(j < n) alpha j <= a * (\sum_(j < n - i) alpha j) + \sum_(j < i) b ^ j
3c0
\sum_(0 <= i < n) alpha i <= \sum_(0 <= i < n - i) a * alpha i + \sum_(0 <= i < i) b ^ i
5678f433c1
aux:forall u v w n n0 n1 : nat, u = v + w -> (v != 0) * alpha n <= a * alpha n0 -> (w != 0) * alpha n <= b ^ n1 -> \sum_(n <= i0 < n + u) alpha i0 <= \sum_(n0 <= i < n0 + v) a * alpha i + \sum_(n1 <= i0 < n1 + w) b ^ i0

3c6
3c0
forall u v w n n0 n1 : nat, u = v + w -> (v != 0) * alpha n <= a * alpha n0 -> (w != 0) * alpha n <= b ^ n1 -> \sum_(n <= i0 < n + u) alpha i0 <= \sum_(n0 <= i < n0 + v) a * alpha i + \sum_(n1 <= i0 < n1 + w) b ^ i0
3ca
\sum_(0 <= i < 0 + n) alpha i <= \sum_(0 <= i < 0 + (n - i)) a * alpha i + \sum_(0 <= i < 0 + i) b ^ i
3cc
3c0
n = n - i + i
3c0
(n - i != 0) * alpha 0 <= a * alpha 0
3c0
(i != 0) * alpha 0 <= b ^ 0
3cd
3d4
3c0
3d9
3da3cd
3de
3c0
3db
3cc
3c0
3ce
5678f
n, i, j, k:nat

(0 != 0) * alpha i <= b ^ k -> \sum_(i <= i0 < i + 0) alpha i0 <= \sum_(j <= i < j + 0) a * alpha i + \sum_(k <= i0 < k + 0) b ^ i0
5678f
n, u:nat
IH:forall v w n n0 n1 : nat, u = v + w -> (v != 0) * alpha n <= a * alpha n0 -> (w != 0) * alpha n <= b ^ n1 -> \sum_(n <= i0 < n + u) alpha i0 <= \sum_(n0 <= i < n0 + v) a * alpha i + \sum_(n1 <= i0 < n1 + w) b ^ i0
w, i, j, k:nat
uvw:u.+1 = 0 + w.+1
aM1:(0 != 0) * alpha i <= a * alpha j
aM2:(w.+1 != 0) * alpha i <= b ^ k
\sum_(i <= i0 < i + u.+1) alpha i0 <= \sum_(j <= i < j + 0) a * alpha i + \sum_(k <= i0 < k + w.+1) b ^ i0
5678f3f13f2
v, i, j, k:nat
uvw:u.+1 = v.+1 + 0
aM1:(v.+1 != 0) * alpha i <= a * alpha j
aM2:(0 != 0) * alpha i <= b ^ k
\sum_(i <= i0 < i + u.+1) alpha i0 <= \sum_(j <= i < j + v.+1) a * alpha i + \sum_(k <= i0 < k + 0) b ^ i0
5678f3f13f2
v, w, i, j, k:nat
uvw:u.+1 = v.+1 + w.+1
3fc3f6
\sum_(i <= i0 < i + u.+1) alpha i0 <= \sum_(j <= i < j + v.+1) a * alpha i + \sum_(k <= i0 < k + w.+1) b ^ i0
3e9
3f0
3f7
3f83ff
406
3f0
alpha i + \sum_(i.+1 <= i < i + u.+1) alpha i <= \sum_(j <= i < j + 0) a * alpha i + \sum_(k <= i0 < k + w.+1) b ^ i0
408
3f0
alpha i + \sum_(i.+1 <= i < i + u.+1) alpha i <= \sum_(j <= i < j + 0) a * alpha i + (b ^ k + \sum_(k.+1 <= i < k + w.+1) b ^ i)
408
3f0
alpha i + \sum_(i.+1 <= i < i + u.+1) alpha i <= b ^ k + (\sum_(j <= i < j + 0) a * alpha i + \sum_(k.+1 <= i < k + w.+1) b ^ i)
408
3f0
\sum_(i.+1 <= i < i + u.+1) alpha i <= \sum_(j <= i < j + 0) a * alpha i + \sum_(k.+1 <= i < k + w.+1) b ^ i
408
3f0
\sum_(i.+1 <= i < i.+1 + u) alpha i <= \sum_(j <= i < j + 0) a * alpha i + \sum_(k.+1 <= i < k.+1 + w) b ^ i
408
5678f
n, u, w, i, j, k:nat
3f43f53f6

(w != 0) * alpha i.+1 <= b ^ k.+1
408
5678f4223f43f53f6
w1:nat

(w1.+1 != 0) * alpha i.+1 <= b ^ k.+1
408
5678f4223f43f5428
aM2:alpha i <= b ^ k

alpha i.+1 <= b ^ k.+1
408
42d
a * alpha i <= b ^ k.+1
42d3a7
3f83ff
42d
3a7
408
3f9
3fe
3ff
43a
3f9
alpha i + \sum_(i.+1 <= i < i + u.+1) alpha i <= \sum_(j <= i < j + v.+1) a * alpha i + \sum_(k <= i0 < k + 0) b ^ i0
43c
3f9
alpha i + \sum_(i.+1 <= i < i + u.+1) alpha i <= a * alpha j + \sum_(j.+1 <= i < j + v.+1) a * alpha i + \sum_(k <= i0 < k + 0) b ^ i0
43c
3f9
alpha i + \sum_(i.+1 <= i < i + u.+1) alpha i <= a * alpha j + (\sum_(j.+1 <= i < j + v.+1) a * alpha i + \sum_(k <= i0 < k + 0) b ^ i0)
43c
3f9
\sum_(i.+1 <= i < i + u.+1) alpha i <= \sum_(j.+1 <= i < j + v.+1) a * alpha i + \sum_(k <= i0 < k + 0) b ^ i0
43c
3f9
\sum_(i.+1 <= i < i.+1 + u) alpha i <= \sum_(j.+1 <= i < j.+1 + v) a * alpha i + \sum_(k <= i0 < k + 0) b ^ i0
43c
5678f
n, u, v, i, j, k:nat
3fb3fc3fd

(v != 0) * alpha i.+1 <= a * alpha j.+1
43c
5678f4563fb3fc3fd
v1:nat

(v1.+1 != 0) * alpha i.+1 <= a * alpha j.+1
43c
5678f4563fb3fd45c
aM1:alpha i <= a * alpha j

alpha i.+1 <= a * alpha j.+1
43c
461
alpha i < a * alpha j.+1
43c
5678f4563fb3fd45c

a * alpha j < a * alpha j.+1
43c
400
403
400
463
5678f3f13f24014023fc3f6
aM3:alpha i.+1 <= a * alpha j.+1
403
5678f3f13f24014023f6462

463
473
47a
467
473
5678f3f13f24014023f6

46c
473
475
403
475
a * alpha j <= b ^ k -> \sum_(i <= i1 < i + u.+1) alpha i1 <= \sum_(j <= i < j + v.+1) a * alpha i + \sum_(k <= i1 < k + w.+1) b ^ i1
5678f3f13f24014023fc3f6476
bLaa:b ^ k < a * alpha j
403
486
5678f3f13f24014023fc3f6476
aaEb:a * alpha j = b ^ k

403
5678f3f13f24014023fc3f6476
aaLb:a * alpha j < b ^ k
403
48a
491
a %| b ^ k -> \sum_(i <= i0 < i + u.+1) alpha i0 <= \sum_(j <= i < j + v.+1) a * alpha i + \sum_(k <= i0 < k + w.+1) b ^ i0
493
491
gcdn a (b ^ k) = a -> \sum_(i <= i0 < i + u.+1) alpha i0 <= \sum_(j <= i < j + v.+1) a * alpha i + \sum_(k <= i0 < k + w.+1) b ^ i0
493
491
1 = a -> \sum_(i <= i0 < i + u.+1) alpha i0 <= \sum_(j <= i < j + v.+1) a * alpha i + \sum_(k <= i0 < k + w.+1) b ^ i0
493
495
403
489
4a4
495
alpha i + \sum_(i.+1 <= i < i + u.+1) alpha i <= \sum_(j <= i < j + v.+1) a * alpha i + \sum_(k <= i0 < k + w.+1) b ^ i0
489
495
alpha i + \sum_(i.+1 <= i < i + u.+1) alpha i <= a * alpha j + \sum_(j.+1 <= i < j + v.+1) a * alpha i + \sum_(k <= i0 < k + w.+1) b ^ i0
489
495
alpha i + \sum_(i.+1 <= i < i + u.+1) alpha i <= a * alpha j + (\sum_(j.+1 <= i < j + v.+1) a * alpha i + \sum_(k <= i0 < k + w.+1) b ^ i0)
489
495
\sum_(i.+1 <= i < i + u.+1) alpha i <= \sum_(j.+1 <= i < j + v.+1) a * alpha i + \sum_(k <= i0 < k + w.+1) b ^ i0
489
495
\sum_(i.+1 <= i < i.+1 + u) alpha i <= \sum_(j.+1 <= i < j.+1 + v) a * alpha i + \sum_(k <= i0 < k + w.+1) b ^ i0
489
5678f
n, u, v, w, i, j, k:nat
4023fc3f6476496

457
4be
(w.+1 != 0) * alpha i.+1 <= b ^ k
48a
5678f4bf4023fc3f647649645c

45d
4c0
4be
4c2
489
5678f4bf40247649646242e

alpha i.+1 <= b ^ k
489
4cd
alpha i < b ^ k
489
48b
403
48b
4aa
48b
alpha i + \sum_(i.+1 <= i < i + u.+1) alpha i <= \sum_(j <= i < j + v.+1) a * alpha i + (b ^ k + \sum_(k.+1 <= i < k + w.+1) b ^ i)
48b
alpha i + \sum_(i.+1 <= i < i + u.+1) alpha i <= b ^ k + (\sum_(j <= i < j + v.+1) a * alpha i + \sum_(k.+1 <= i < k + w.+1) b ^ i)
48b
\sum_(i.+1 <= i < i + u.+1) alpha i <= \sum_(j <= i < j + v.+1) a * alpha i + \sum_(k.+1 <= i < k + w.+1) b ^ i
48b
\sum_(i.+1 <= i < i.+1 + u) alpha i <= \sum_(j <= i < j + v.+1) a * alpha i + \sum_(k.+1 <= i < k.+1 + w) b ^ i
5678f4bf4023fc3f647648c

(v.+1 != 0) * alpha i.+1 <= a * alpha j
4ec423
5678f4bf40247648c46242e

alpha i.+1 <= a * alpha j
4ee
4f3
isAB (a * alpha j)
4f3
alpha i < a * alpha j
4ef
4f3
4fb
4ee
4ec
423
5678f4bf4023fc3f647648c428

429
5678f4bf40247648c42846242e

42f
509
alpha i < b ^ k.+1
5678f4bf40247648c428462

b ^ k < b ^ k.+1
by rewrite ltn_exp2l. Qed.
a4
alpha 0 = 1
514
by []. Qed.
a4
alpha 1 = a
519
by rewrite /alpha /= !ifT //= muln1 !inE eqxx ?orbT. Qed.
5678f
k, n:nat

b ^ k <= alpha n -> k <= n
51e
5678f
k:nat

b ^ k <= alpha 0 -> k <= 0
5678f19
IH:forall k : nat, b ^ k <= alpha n -> k <= n
528
Hk:b ^ k.+1 <= alpha n.+1
k < n.+1
52c
52f
52c
b ^ k < alpha n.+1
by apply: leq_trans Hk; rewrite ltn_exp2l. Qed.
18
alpha n < b ^ n.+1
538
by rewrite ltnNge; apply/negP => /b_exp_leq; rewrite ltnn. Qed.
520
b ^ k < alpha n -> k < n
53d
5678f521
H:b ^ k < alpha n.+1

52f
by rewrite ltnS; apply/b_exp_leq/(isAB_geq_alphaSn (isAB_bexp _)). Qed.
42
b ^ i < alpha n.+1 < b ^ i.+1 -> alpha n.+1 = a * alpha (n - i)
547
5678f43
beLa:b ^ i < alpha n.+1
aLbe:alpha n.+1 < b ^ i.+1

alpha n.+1 = a * alpha (n - i)
54e
i <= n
5678f4354f550
iLm:i <= n
551
54e
1a7
556
558
551
5678f4354f550559
y:nat
Hxy:alpha n.+1 = a ^ (0, y).1 * b ^ (0, y).2

551
5678f4354f550559
x, y:nat
Hxy:alpha n.+1 = a ^ (x.+1, y).1 * b ^ (x.+1, y).2
551
5678f43559564565

b ^ i < a ^ (0, y).1 * b ^ (0, y).2 -> a ^ (0, y).1 * b ^ (0, y).2 < b ^ i.+1 -> a ^ (0, y).1 * b ^ (0, y).2 = a * alpha (n - i)
566
56e
i < (0, y).2 -> (0, y).2 <= i -> b ^ (0, y).2 = a * alpha (n - i)
566
568
551
5678f4354f55055956956a528
Hk:alpha k = a ^ x * b ^ y

551
5678f4354f55055956956a52857b
la:=[seq alpha (j : 'I_n.+2) | j <- enum 'I_n.+2]:seq nat

551
5678f4354f55055956956a52857b580
lb:=[seq b ^ (j : 'I_i.+1) | j <- enum 'I_i.+1]:seq nat

551
5678f4354f55055956956a52857b580585
lc:=[seq a * alpha (j : 'I_(n - i)) | j <- enum 'I_(n - i)]:seq nat

551
589
uniq la
5678f4354f55055956956a52857b58058558a
Ula:uniq la
551
589
injective (fun j : 'I_n.+2 => alpha j)
58f
5678f4354f55055956956a52857b58058558a
k1, k2:ordinal_eqType n.+2
H:alpha k1 = alpha k2

k1 = k2
58f
59a
k1 <= k2 -> k1 = k2
58f
591
551
5678f4354f55055956956a52857b58058558a592
Sla:size la = n.+2

551
5678f4354f55055956956a52857b58058558a5925a9
la1:=[seq x <- la | a %| x]:seq nat

551
5678f4354f55055956956a52857b58058558a5925a95ae
la2:=[seq x <- la | ~~ (a %| x)]:seq nat

551
5678f4354f55055956956a52857b58058558a5925a95ae5b3
lk:=[seq a * alpha (j : 'I_k.+1) | j <- enum 'I_k.+1]:seq nat

551
5678f4354f55055956956a52857b58058558a5925a95ae5b35b8
Slk:size lk = k.+1

551
5bc
lk =i la1
5678f4354f55055956956a52857b58058558a5925a95ae5b35b85bd
lkEla1:lk =i la1
551
5678f4354f55055956956a52857b58058558a5925a95ae5b35b85bd
u:nat_eqType

(u \in lk) = (a %| u) && (u \in la)
5c2
5c9
(exists2 x : ordinal_eqType k.+1, x \in enum 'I_k.+1 & u = a * alpha x) -> (a %| u) && (u \in la)
5c9
(a %| u) && (u \in la) -> exists2 x : ordinal_eqType k.+1, x \in enum 'I_k.+1 & u = a * alpha x
5c3
5678f4354f55055956956a52857b58058558a5925a95ae5b35b85bd5ca
z:ordinal_eqType k.+1
Hz:z \in enum 'I_k.+1

a * alpha z \in la
5d0
5678f4354f55055956956a52857b58058558a5925a95ae5b35b85bd5ca5d75d8
x1, y1:nat
Hx1y1:alpha z = a ^ (x1, y1).1 * b ^ (x1, y1).2

5d9
5d0
5678f4354f55055956956a52857b58058558a5925a95ae5b35b85bd5ca5d75d85de5df
t:nat
Ht:alpha t = a ^ x1.+1 * b ^ y1

5d9
5d0
5678f4354f55055956956a52857b58058558a5925a95ae5b35b85bd5ca5d75d85de5df5e45e5
H1t:t < n.+2

5d9
5e3
t < n.+2
5d15c3
5e9
a * alpha z = alpha (Ordinal H1t)
5eb
5e3
5ed
5d0
5e3
alpha n.+1 < alpha t -> false
5d0
5e3
~~ (a * alpha z <= a * alpha k) -> false
5d0
5e3
~~ (alpha z <= alpha k) -> false
5d0
5e3
z < k.+1 -> ~~ (alpha z <= alpha k) -> false
5d0
5c9
5d2
5c2
5678f4354f55055956956a52857b58058558a5925a95ae5b35b85bd5ca
v:ordinal_eqType n.+2
Hv:v \in enum 'I_n.+2
Ha:a %| alpha v

exists2 x : ordinal_eqType k.+1, x \in enum 'I_k.+1 & alpha v = a * alpha x
5c2
5678f4354f55055956956a52857b58058558a5925a95ae5b35b85bd5ca60c60d60e
y1:nat
Hx1y1:alpha v = a ^ (0, y1).1 * b ^ (0, y1).2

60f
5678f4354f55055956956a52857b58058558a5925a95ae5b35b85bd5ca60c60d60e5de
Hx1y1:alpha v = a ^ (x1.+1, y1).1 * b ^ (x1.+1, y1).2
60f
5c3
5678f4354f55055956956a52857b58058558a5925a95ae5b35b85bd5ca60c60d614615

gcdn a (b ^ y1) = a -> exists2 x : 'I_k.+1, x \in enum 'I_k.+1 & b ^ y1 = a * alpha x
616
61d
1 = a -> exists2 x : 'I_k.+1, x \in enum 'I_k.+1 & b ^ y1 = a * alpha x
616
618
60f
5c2
5678f4354f55055956956a52857b58058558a5925a95ae5b35b85bd5ca60c60d60e5de619
j1:nat
Hj1:alpha j1 = a ^ x1 * b ^ y1

60f
5c2
5678f4354f55055956956a52857b58058558a5925a95ae5b35b85bd5ca60c60d60e5de61962a62b
H1j1:j1 < k.+1

60f
629
j1 < k.+1
5c3
62f
alpha v = a * alpha (Ordinal H1j1)
631
629
633
5c2
629
alpha k < alpha j1 -> false
5c2
629
alpha n.+1 < alpha v -> false
5c2
629
alpha v < alpha n.+2
5c2
5c4
551
5c4
lb =i la2
5678f4354f55055956956a52857b58058558a5925a95ae5b35b85bd5c5
lbEla2:lb =i la2
551
5678f4354f55055956956a52857b58058558a5925a95ae5b35b85bd5c55ca

u \in la2 -> u \in lb
655
u \in lb -> u \in la2
64f
5678f4354f55055956956a52857b58058558a5925a95ae5b35b85bd5c55ca60c
Hx:v \in enum 'I_n.+2

~~ (a %| alpha v) -> alpha v \in lb
657
65d
alpha v < alpha n.+2 -> ~~ (a %| alpha v) -> alpha v \in lb
657
5678f4354f55055956956a52857b58058558a5925a95ae5b35b85bd5c55ca60c65e
u1, v1:nat

a ^ u1.+1 * b ^ v1 < alpha n.+2 -> ~~ (a %| a ^ u1.+1 * b ^ v1) -> a ^ u1.+1 * b ^ v1 \in lb
5678f4354f55055956956a52857b58058558a5925a95ae5b35b85bd5c55ca60c65e45c
a ^ 0 * b ^ v1 < alpha n.+2 -> ~~ (a %| a ^ 0 * b ^ v1) -> a ^ 0 * b ^ v1 \in lb
65864f
66c
66d
657
5678f4354f55055956956a52857b58058558a5925a95ae5b35b85bd5c55ca60c65e45c
H:b ^ v1 < alpha n.+2

b ^ v1 \in lb
657
674
b ^ v1 < b ^ i.+1
5678f4354f55055956956a52857b58058558a5925a95ae5b35b85bd5c55ca60c65e45c675
v1Li:v1 < i.+1
676
65864f
5678f4354f55956956a52857b58058558a5925a95ae5b35b85bd5c55ca60c65e45c675

b ^ v1 <= alpha n.+1
67b
67d
676
657
655
659
64e
5678f4354f55055956956a52857b58058558a5925a95ae5b35b85bd5c55ca
u1:ordinal_eqType i.+1

b ^ u1 \in la2
64e
68d
~~ (a %| b ^ u1)
68d
b ^ u1 \in la
64f
68d
gcdn a (b ^ u1) = a -> False
694
68d
1 = a -> False
694
68d
696
64e
5678f4354f55055956956a52857b58058558a5925a95ae5b35b85bd5c55ca68e62a
Hj1:alpha j1 = b ^ u1

696
64e
5678f4354f55055956956a52857b58058558a5925a95ae5b35b85bd5c55ca68e62a6a6
j1Ln:j1 < n.+2

696
6a5
j1 < n.+2
64f
6a5
6ae
64e
6a5
alpha j1 <= alpha n.+1
64e
6a5
alpha j1 <= b ^ i
64e
650
551
650
a * alpha k = a * alpha (n - i)
650
k = n - i
650
size la = size la1 + size la2
650
k = size la1 + size la2 - i.+2
650
6cb
650
uniq la1
650
uniq la1 -> k = size la1 + size la2 - i.+2
650
58e
6d3
650
596
6d3
5678f4354f55055956956a52857b58058558a5925a95ae5b35b85bd5c565159b59c

59d
6d3
6df
5a1
6d3
650
6d5
650
uniq lk
650
k = size lk + size la2 - i.+2
650
injective (fun j : 'I_k.+1 => a * alpha j)
6ea
5678f4354f55055956956a52857b58058558a5925a95ae5b35b85bd5c5651
k1, k2:ordinal_eqType k.+1
H:a * alpha k1 = a * alpha k2

59d
6ea
6f4
alpha k2 < alpha k1 -> k1 = k2
6f45a1
6eb
6f4
5a1
6ea
6f4
alpha k1 < alpha k2 -> k1 = k2
6ea
650
6ec
650
k = k.+1 + size la2 - i.+2
650
uniq la2
650
uniq la2 -> k = k.+1 + size la2 - i.+2
6d870f
6db70f
6de70f
6e270f
650
711
650
uniq lb
650
k = k.+1 + size lb - i.+2
650
injective (fun j : 'I_i.+1 => b ^ j)
721
650
723
650
k = k.+1 + i.+1 - i.+2
by rewrite subSS addnK. Qed.
42
b ^ i <= alpha n < b ^ i.+1 -> \sum_(i0 < n.+1) alpha i0 = a * (\sum_(i0 < n - i) alpha i0) + \sum_(i0 < i.+1) b ^ i0
730
36
b ^ i <= alpha 0 < b ^ i.+1 -> \sum_(i0 < 1) alpha i0 = a * (\sum_(i0 < 0 - i) alpha i0) + \sum_(i0 < i.+1) b ^ i0
5678f19
IH:forall i : nat, b ^ i <= alpha n < b ^ i.+1 -> \sum_(i0 < n.+1) alpha i0 = a * (\sum_(i0 < n - i) alpha i0) + \sum_(i0 < i.+1) b ^ i0
37
b ^ i <= alpha n.+1 < b ^ i.+1 -> \sum_(i0 < n.+2) alpha i0 = a * (\sum_(i0 < n.+1 - i) alpha i0) + \sum_(i0 < i.+1) b ^ i0
a4
\sum_(i0 < 1) alpha i0 = a * (\sum_(i0 < 0 - 0) alpha i0) + \sum_(i0 < 1) b ^ i0
738
73a
73c
5678f1973b37
Ha:b ^ i = alpha n.+1
Hb:alpha n.+1 < b ^ i.+1

\sum_(i0 < n.+2) alpha i0 = a * (\sum_(i0 < n.+1 - i) alpha i0) + \sum_(i0 < i.+1) b ^ i0
5678f1973b37
Ha:b ^ i < alpha n.+1
749
74a
5678f1973b
H:b ^ 0 = alpha n.+1

alpha n.+1 < b ^ 1 -> \sum_(i0 < n.+2) alpha i0 = a * (\sum_(i0 < n.+1 - 0) alpha i0) + \sum_(i0 < 1) b ^ i0
5678f1973b37
Ha:b ^ i.+1 = alpha n.+1
Hb:alpha n.+1 < b ^ i.+2
\sum_(i0 < n.+2) alpha i0 = a * (\sum_(i0 < n.+1 - i.+1) alpha i0) + \sum_(i0 < i.+2) b ^ i0
74c
752
alpha 0 < alpha n.+1 -> alpha n.+1 < b ^ 1 -> \sum_(i0 < n.+2) alpha i0 = a * (\sum_(i0 < n.+1 - 0) alpha i0) + \sum_(i0 < 1) b ^ i0
755
757
75a
74b
757
\sum_(i < n.+1) alpha i + alpha n.+1 = a * (\sum_(i0 < n.+1 - i.+1) alpha i0) + (\sum_(i0 < i.+1) b ^ i0 + alpha n.+1)
74b
757
\sum_(i < n.+1) alpha i = a * (\sum_(i0 < n.+1 - i.+1) alpha i0) + \sum_(i0 < i.+1) b ^ i0
74b
757
\sum_(i < n.+1) alpha i = a * (\sum_(i0 < n - i) alpha i0) + \sum_(i0 < i.+1) b ^ i0
74b
5678f43758759

b ^ i <= alpha n < b ^ i.+1
74b
771
b ^ i <= alpha n
74b
771
b ^ i < alpha n.+1
74b
74d
74a
74d
\sum_(i0 < n.+2) alpha i0 = a * (\sum_(i0 < (n - i).+1) alpha i0) + \sum_(i0 < i.+1) b ^ i0
74d
addn_monoid (\big[addn_monoid/0]_(i < n.+1) alpha (widen_ord (leqnSn n.+1) i)) (alpha ord_max) = a * addn_monoid (\big[addn_monoid/0]_(i0 < n - i) alpha (widen_ord (leqnSn (n - i)) i0)) (alpha ord_max) + \sum_(i0 < i.+1) b ^ i0
74d
addn_monoid (\big[addn_monoid/0]_(i < n.+1) alpha (widen_ord (leqnSn n.+1) i)) (alpha ord_max) = a * \big[addn_monoid/0]_(i0 < n - i) alpha (widen_ord (leqnSn (n - i)) i0) + \sum_(i0 < i.+1) b ^ i0 + a * alpha ord_max
74d
alpha ord_max = a * alpha ord_max
74d
\big[addn_monoid/0]_(i < n.+1) alpha (widen_ord (leqnSn n.+1) i) = a * \big[addn_monoid/0]_(i0 < n - i) alpha (widen_ord (leqnSn (n - i)) i0) + \sum_(i0 < i.+1) b ^ i0
74d
790
5678f4374e749

772
797
true && (alpha n < b ^ i.+1)
5678f4374e

alpha n < (alpha n.+1).+1
by rewrite ltnS ltnW // alpha_ltn. Qed. End Main. Section S23. Local Notation α := (alpha 2 3). (* First 60 element of the list *)
= [:: 1; 2; 3; 4; 6; 8; 9; 12; 16; 18; 24; 27; 32; 36; 48; 54; 64; 72; 81; 96; 108; 128; 144; 162; 192; 216; 243; 256; 288; 324; 384; 432; 486; 512; 576; 648; 729; 768; 864; 972; 1024; 1152; 1296; 1458; 1536; 1728; 1944; 2048; 2187; 2304; 2592; 2916; 3072; 3456; 3888; 4096; 4374; 4608; 5184; 5832] : seq nat
Definition dsum_alpha n := \sum_(i < n) α i. Local Notation S1 := dsum_alpha.

S1 0 = 0
7a3
by rewrite /S1 big_ord0 // => [] []. Qed.

S1 1 = 1
7a8
by rewrite /S1 big_ord_recr /= big_ord0. Qed.
19

~~ odd n -> (n./2).*2 = n
7ad
by move=> nO; rewrite -{2}(odd_double_half n) (negPf nO). Qed.
43

i <= n -> S1 n <= (S1 (n - i)).*2 + ((3 ^ i).-1)./2
7b3
433c1

S1 n <= (S1 (n - i)).*2 + ((3 ^ i).-1)./2
7bb
~~ odd (3 ^ i).-1
7bb
(S1 n).*2 <= ((S1 (n - i)).*2).*2 + (3 ^ i).-1
7bb
7c3
7bb
2 * S1 n <= 2 * (2 * S1 (n - i)) + 3.-1 * (\sum_(i0 < i) 3 ^ i0)
7bb
S1 n <= 2 * S1 (n - i) + \sum_(i0 < i) 3 ^ i0
by apply: sum_alpha_leq. Qed.
7af
exists i : nat, n < 3 ^ i
7d0
by exists n; apply: ltn_expl. Qed. Definition log3 k := (ex_minn (log3_proof k)).-1.

log3 0 = 0
7d5
by rewrite /log3; case: ex_minnP => [] [|m] //= _ /(_ 0 isT); case: m. Qed.

log3 1 = 0
7da
by rewrite /log3; case: ex_minnP => [] [|m] //= _ /(_ 1 isT); case: m. Qed.
7af
n < 3 ^ (log3 n).+1
7df
19
nLm:n < 3 ^ 0
H:forall n0 : nat, n < 3 ^ n0 -> 0 <= n0

n < 3 ^ 1
by apply: leq_trans nLm _. Qed.
7af
0 < n -> 3 ^ log3 n <= n
7eb
n, m:nat
nLm:n < 3 ^ m.+1
H:forall n0 : nat, n < 3 ^ n0 -> m < n0
nL:0 < n

3 ^ m <= n
by rewrite leqNgt; apply/negP => /H; rewrite ltnn. Qed.
7af
log3 (α n) < n.+1
7f9
7af
3 ^ log3 (α n) < 3 ^ n.+1
7af
α n < 3 ^ n.+1
by apply: alpha_exp_bound. Qed.
7af
0 < n -> S1 n = (S1 (n - (log3 (α n.-1)).+1)).*2 + ((3 ^ (log3 (α n.-1)).+1).-1)./2
806
7af
S1 n.+1 = (S1 (n.+1 - (log3 (α n.+1.-1)).+1)).*2 + ((3 ^ (log3 (α n.+1.-1)).+1).-1)./2
7af
(S1 n.+1).*2 = ((S1 (n.+1 - (log3 (α n.+1.-1)).+1)).*2 + ((3 ^ (log3 (α n.+1.-1)).+1).-1)./2).*2
7af
~~ odd (3 ^ (log3 (α n.+1.-1)).+1).-1
7af
(S1 n.+1).*2 = ((S1 (n.+1 - (log3 (α n.+1.-1)).+1)).*2).*2 + (3 ^ (log3 (α n.+1.-1)).+1).-1
7af
818
7af
S1 n.+1 = 2 * S1 (n.+1 - (log3 (α n.+1.-1)).+1) + \sum_(i < (log3 (α n.+1.-1)).+1) 3 ^ i
7af
3 ^ log3 (α n) <= α n < 3 ^ (log3 (α n)).+1
19
iLn:3 ^ log3 (α n) <= α n < 3 ^ (log3 (α n)).+1
81f
7af
0 < α n
824
826
81f
by apply: sum_alpha_eq. Qed.
7af
S1 n.+1 = \min_(i <= n) ((S1 i).*2 + ((3 ^ (n.+1 - i)).-1)./2)
830
7af
\min_(i <= n) ((S1 i).*2 + ((3 ^ (n.+1 - i)).-1)./2) <= S1 n.+1
7af
S1 n.+1 <= \min_(i <= n) ((S1 i).*2 + ((3 ^ (n.+1 - i)).-1)./2)
7af
\min_(i <= n) ((S1 i).*2 + ((3 ^ (n.+1 - i)).-1)./2) <= (S1 (n.+1 - (log3 (α n.+1.-1)).+1)).*2 + ((3 ^ (n.+1 - (n.+1 - (log3 (α n)).+1))).-1)./2
838
7af
n.+1 - (log3 (α n.+1.-1)).+1 <= n
838
7af
83a
7bb
S1 n.+1 <= (S1 i).*2 + ((3 ^ (n.+1 - i)).-1)./2
7bb
S1 n.+1 <= (S1 (n.+1 - (n.+1 - i))).*2 + ((3 ^ (n.+1 - i)).-1)./2
by apply/S1_leq/leq_subr. Qed.
7af
delta S1 n = α n
84f
by rewrite /S1 /delta big_ord_recr /= addnC addnK. Qed. Definition dsum_alphaL l := conv (fun i => (S1 i).*2) (fun i => l * (3 ^ i).-1./2). Notation " 'S_[' l ']' " := (dsum_alphaL l) (format "S_[ l ]"). Definition alphaL l n := delta S_[l] n. Notation " 'α_[' l ']' " := (alphaL l) (format "α_[ l ]").
f, g:nat -> nat
19

(forall i : nat, i <= n -> f i <= g i) -> \min_(i <= n) f i <= \min_(i <= n) g i
854
85719
IH:(forall i : nat, i <= n -> f i <= g i) -> \min_(i <= n) f i <= \min_(i <= n) g i
H:forall i : nat, i <= n.+1 -> f i <= g i

minn (f n.+1) (\min_(i <= n) f i) <= minn (g n.+1) (\min_(i <= n) g i)
8571985e85f373c1

f i <= g i
by rewrite H // (leq_trans iLn). Qed.
7af
increasing (dsum_alphaL^~ n)
867
n, l:nat

\min_(i <= n) ((S1 i).*2 + l * ((3 ^ (n - i)).-1)./2) <= \min_(i <= n) ((S1 i).*2 + l.+1 * ((3 ^ (n - i)).-1)./2)
n, l, i:nat

(S1 i).*2 + l * ((3 ^ (n - i)).-1)./2 <= (S1 i).*2 + l.+1 * ((3 ^ (n - i)).-1)./2
by rewrite leq_add2l leq_mul2r leqnSn orbT. Qed.
7af
concave (dsum_alphaL^~ n)
878
7b5
S_[i] n + S_[i.+2] n <= (S_[i.+1] n).*2
7b5
S_[i] n + S_[i.+2] n <= (\min_(i0 <= n) ((S1 i0).*2 + i.+1 * ((3 ^ (n - i0)).-1)./2)).*2
43
f:=fun i x : nat => (S1 x).*2 + i * ((3 ^ (n - x)).-1)./2:nat -> nat -> nat

883
43888
j:'I_n.+1

S_[i] n + S_[i.+2] n <= (f i.+1 j).*2
88c
(f i.+1 j).*2 = f i j + f i.+2 j
88c
S_[i] n + S_[i.+2] n <= f i j + f i.+2 j
4388888d
x:=(S1 j).*2:nat
y:=((3 ^ (n - j)).-1)./2:nat

(x + i.+1 * y).*2 = x + i * y + (x + i.+2 * y)
893
899
(x + i.+1 * y).*2 = x.*2 + (i + i.+2) * y
893
88c
895
88c
S_[i] n <= f i j
88c
S_[i.+2] n <= f i.+2 j
88c
8aa
by apply: bigmin_inf (leqnn _); rewrite -ltnS. Qed.
l, n:nat

(S1 n).*2 <= l -> S_[l] n = (S1 n).*2
8af
8b2
S1Ll:(S1 n).*2 <= l

S_[l] n == (S1 n).*2
8b8
\min_(i <= n) ((S1 i).*2 + l * ((3 ^ (n - i)).-1)./2) <= (S1 n).*2
8b8
(S1 n).*2 <= \min_(i <= n) ((S1 i).*2 + l * ((3 ^ (n - i)).-1)./2)
8b8
(S1 n).*2 + l * ((3 ^ (n - n)).-1)./2 <= (S1 n).*2
8bf
8b8
8c1
8b28b937

i <= n -> (S1 n).*2 <= (S1 i).*2 + l * ((3 ^ (n - i)).-1)./2
8b28b937
iLn:i < n

(S1 n).*2 <= (S1 i).*2 + l * ((3 ^ (n - i)).-1)./2
l, n, i:nat
8d2

l <= (S1 i).*2 + l * ((3 ^ (n - i)).-1)./2
8d7
l <= l * ((3 ^ (n - i)).-1)./2
8d7
1 < (3 ^ (n - i)).-1
by rewrite -ltnS prednK ?expn_gt0 // (@leq_exp2l _ 1) // subn_gt0. Qed.
37

delta (fun i : nat => (S1 i).*2) i = (α i).*2
8e3
by rewrite /delta -doubleB [_ - _]delta_S1. Qed.

convex (fun i : nat => (S1 i).*2)
8e9
8e5
(S1 i).*2 <= (S1 i.+1).*2
8e5
delta (fun i : nat => (S1 i).*2) i <= delta (fun i : nat => (S1 i).*2) i.+1
8e5
8f3
by rewrite !delta_2S1 leq_double; apply/ltnW/alpha_ltn. Qed.
l, i:nat

delta (fun i : nat => l * ((3 ^ i).-1)./2) i = l * 3 ^ i
8f8
8fa
l * ((3 ^ i.+1).-1 - (3 ^ i).-1)./2 = l * 3 ^ i
8fa
l * (3 ^ i.+1 - 3 ^ i)./2 = l * 3 ^ i
by rewrite expnS -[X in _ * ((_ - X))./2]mul1n -mulnBl mul2n doubleK. Qed.
l:nat

convex (fun i : nat => l * ((3 ^ i).-1)./2)
907
8fa
l * ((3 ^ i).-1)./2 <= l * ((3 ^ i.+1).-1)./2
8fa
delta (fun i : nat => l * ((3 ^ i).-1)./2) i <= delta (fun i : nat => l * ((3 ^ i).-1)./2) i.+1
8fa
(3 ^ i).-1 <= (3 ^ i.+1).-1
911
8fa
913
by rewrite !delta_3l leq_mul2l leq_exp2l // leqnSn orbT. Qed.
909
convex S_[l]
91c
907
by apply: convex_3l. Qed.
8b1
α_[l] n = fmerge (fun i : nat => (α i).*2) (fun i : nat => l * 3 ^ i) n
922
8b1
fmerge (delta (fun i : nat => (S1 i).*2)) (delta (fun i : nat => l * ((3 ^ i).-1)./2)) n = fmerge (fun i : nat => (α i).*2) (fun i : nat => l * 3 ^ i) n
8b18eb
8d8

8fc
92a
8b1
8eb
by apply: convex_2S1. Qed.
909
increasing α_[l]
934
909
increasing (fmerge (fun i : nat => (α i).*2) (fun i : nat => l * 3 ^ i))
909
increasing (fun i : nat => (α i).*2)
909
increasing (fun i : nat => l * 3 ^ i)
909
942
by move=> n; rewrite leq_mul2l leq_exp2l ?leqnSn ?orbT. Qed.
7af
increasing (alphaL^~ n)
947
86e
93f
86e
increasing (fun i : nat => l.+1 * 3 ^ i)
86e93f
86e942
86e
\max_(i < n.+1) minn (α i).*2 (l * 3 ^ (n - i)) <= \max_(i < n.+1) minn (α i).*2 (l.+1 * 3 ^ (n - i))
94c
86e
950
951952953
957
94d
952953
95c
86e
942
953
960
86e
954
86f
i:ordinal_finType n.+1

minn (α i).*2 (l * 3 ^ (n - i)) <= \max_(i < n.+1) minn (α i).*2 (l.+1 * 3 ^ (n - i))
96a
minn (α i).*2 (l * 3 ^ (n - i)) <= minn (α i).*2 (l.+1 * 3 ^ (n - i))
96a
minn (α i).*2 (l.+1 * 3 ^ (n - i)) <= \max_(i < n.+1) minn (α i).*2 (l.+1 * 3 ^ (n - i))
96a
973
by apply: leq_bigmax. Qed.
8b1
S_[l] n.+1 + S_[l.+1] n <= S_[l] n + S_[l.+1] n.+1
978
8b1
S_[l] n <= S_[l] n.+1
8b1
S_[l] n.+1 - S_[l] n + S_[l.+1] n <= S_[l.+1] n.+1
8b1
982
8b1
S_[l.+1] n <= S_[l.+1] n.+1
8b1
α_[l] n <= S_[l.+1] n.+1 - S_[l.+1] n
8b1
98c
8b1
α_[l] n <= α_[l.+1] n
by apply: increasing_alphaL_l. Qed.
909
α_[l] 0 = minn 2 l
995
909
minn (1.*2 + l * 0) (0.*2 + l * 1) - (0.*2 + l * 0) = minn 2 l
by rewrite muln0 addn0 add0n subn0 muln1. Qed.
7af
S_[0] n = 0
99e
7af
\min_(i <= n) ((S1 i).*2 + 0 * ((3 ^ (n - i)).-1)./2) = 0
7af
minn ((S1 n.+1).*2 + 0 * ((3 ^ (n.+1 - n.+1)).-1)./2) 0 = 0
by rewrite minn0. Qed.

S_[1] =1 S1
9ab

S_[1] 0 = S1 0
8e5
S_[1] i.+1 = S1 i.+1
8e5
9b5
8e5
minn (S1 i.+1).*2 (\min_(i0 <= i) ((S1 i0).*2 + 1 * ((3 ^ (i.+1 - i0)).-1)./2)) = S1 i.+1
8e5
minn (S1 i.+1).*2 (S1 i.+1) = S1 i.+1
8e5
\min_(x <= i) ((S1 x).*2 + 1 * ((3 ^ (i.+1 - x)).-1)./2) = S1 i.+1
8e5
9c3
by rewrite S1_bigmin; apply: bigmin_ext => i1 i1H; rewrite mul1n. Qed.
8b1
S_[l] n <= (S_[1] n).*2
9c8
8b1
S_[l] n <= (S1 n).*2
8b2
lLS:l < (S1 n).*2

9cf
9d3
S_[l] n <= S_[(S1 n).*2] n
8b29d4
H:forall n0 n1 : nat, n0 <= n1 -> S_[n0] n <= S_[n1] n

9d8
by apply/H/ltnW. Qed.
528

α_[1] k = α k
9df
by rewrite /alphaL /delta !S1E -delta_S1. Qed.
8b1
α_[l] n <= (α_[1] n).*2
9e5
8b1
α_[l] n <= (α n).*2
8b2
SLl:(S1 n.+1).*2 <= l

9ec
8b2
lLS:l < (S1 n.+1).*2
9ec
9f0
(S1 n.+1).*2 - (S1 n).*2 <= (α n).*2
9f0
(S1 n).*2 <= l
9f3
9f0
9fc
9f2
9f4
9ec
9f4
α_[l] n <= (S1 n.+1).*2 - (S1 n).*2
9f4
α_[l] n <= S_[(S1 n.+1).*2] n.+1 - (S1 n).*2
9f4
α_[l] n <= S_[(S1 n.+1).*2] n.+1 - S_[(S1 n.+1).*2] n
9f4
(S1 n).*2 <= (S1 n.+1).*2
9f4
α_[l] n <= α_[(S1 n.+1).*2] n
a0f
9f4
a11
by case: convex_2S1. Qed.
17c

iota m n.+1 = m :: iota m.+1 n
a1a
by []. Qed.
T:Type
a:pred T
b:T
12

count a (b :: l) = a b + count a l
a20
by []. Qed.

increasing α
a29
by move=> n; apply/ltnW/alpha_mono. Qed. (* THis is 3.3 *)
m, k:nat

α m + minn (3 ^ k) (α m) <= α (m + k.+1)
a2e
a30
α m + minn (3 ^ k) (α m) <= (α m).*2
a31
amkLam:α (m + k.+1) < (α m).*2
a32
a3a
a32
a3a
α m + 3 ^ k <= α (m + k.+1)
521

α (n + k.+1) < (α n).*2 -> 3 ^ k + α n <= α (n + k.+1)
521
m:=n + k.+1:nat

α m < (α n).*2 -> 3 ^ k + α n <= α m
a4b
k + n < m -> α m < (α n).*2 -> 3 ^ k + α n <= α m
k, n, m:nat

a51
a1c
0 + n < m -> α m < (α n).*2 -> 3 ^ 0 + α n <= α m
528
IH:forall m n : nat, k + n < m -> α m < (α n).*2 -> 3 ^ k + α n <= α m
17c
nkLm:k.+1 + n < m
aL2a:α m < (α n).*2
3 ^ k.+1 + α n <= α m
a5d
a61
528a5e17ca5fa60
l:=[seq α i | i <- iota n (m - n).+1 & 3 %| α i]:seq nat

a61
528a5e17ca5fa60a6930

i \in l -> exists j : nat, i = 3 * α j
528a5e17ca5fa60a69
Il:forall i : nat_eqType, i \in l -> exists j : nat, i = 3 * α j
a61
528a5e17ca5fa60a69
i, j:nat_eqType
ajD3:3 %| α j

exists j0 : nat, α j = 3 * α j0
a6f
528a5e17ca5fa60a69a77a78
i1:nat
ajE:α j = 2 ^ i1 * 3 ^ 0

a79
528a5e17ca5fa60a69a77a78
i1, j1:nat
ajE:α j = 2 ^ i1 * 3 ^ j1.+1
a79
a70
a82
a79
a6f
528a5e17ca5fa60a69a77a78a83a84
k1:nat
ak1E:α k1 = 2 ^ i1 * 3 ^ j1

a79
a6f
a71
a61
528a5e17ca5fa60a69a72
nLm:n <= m

a61
a94
k.+2 < size (iota n (m - n).+1)
528a5e17ca5fa60a69a72a95
iS:k.+2 < size (iota n (m - n).+1)
a61
a9c
a61
a9c
k.+1 < size l
528a5e17ca5fa60a69a72a95a9d
kLsl:k.+1 < size l
a61
a9c
k.+2 < 1 + count (fun i : nat => 3 %| α i) (iota n (m - n).+1)
aa5
528a5e17ca5fa60a69a72a95
iS:k.+2 < count (fun i : nat => 3 %| α i) (iota n (m - n).+1) + count (predC (fun i : nat => 3 %| α i)) (iota n (m - n).+1)

aac
aa5
a94
count (predC (fun i : nat => 3 %| α i)) (iota n (m - n).+1) <= 1
aa5
528a5e17ca5fa69a72a95

α (n + (m - n)) < (α n).*2 -> count (predC (fun i : nat => 3 %| α i)) (iota n (m - n).+1) <= 1
aa5
528a5e17ca5fa69a72a95
u:nat

α (n + u) < (α n).*2 -> count (predC (fun i : nat => 3 %| α i)) (iota n u.+1) <= 1
aa5
a31
IH:forall n : nat, α (n + k) < (α n).*2 -> count (predC (fun i : nat => 3 %| α i)) (iota n k.+1) <= 1
19
H:α (n + k.+1) < (α n).*2

count (predC (fun i : nat => 3 %| α i)) (iota n k.+2) <= 1
aa5
ac4
α (n.+1 + k) < (α n.+1).*2
ac4
count (predC (fun i : nat => 3 %| α i)) (iota n.+1 k.+1) <= 1 -> count (predC (fun i : nat => 3 %| α i)) (iota n k.+2) <= 1
aa6
ac4
ace
aa5
ac4
count (predC (fun i : nat => 3 %| α i)) (iota n.+1 k.+1) <= 1 -> predC (fun i : nat => 3 %| α i) n + count (predC (fun i : nat => 3 %| α i)) (iota n.+1 k.+1) <= 1
aa5
ac4
count (predC (fun i : nat => 3 %| α i)) (iota n.+1 k.+1) < 1 -> true -> predC (fun i0 : nat => 3 %| α i0) n + count (predC (fun i0 : nat => 3 %| α i0)) (iota n.+1 k.+1) <= 1
a31ac519ac6
H1:count (predC (fun i : nat => 3 %| α i)) (iota n.+1 k.+1) = 1
predC (fun i : nat => 3 %| α i) n + count (predC (fun i : nat => 3 %| α i)) (iota n.+1 k.+1) <= 1
aa6
adc
ade
aa5
adc
has (predC (fun i : nat => 3 %| α i)) (iota n.+1 k.+1)
a31ac519ac6add30
iH1:i \in iota n.+1 k.+1
iH2:predC (fun i : nat => 3 %| α i) i
ade
aa6
ae8
ade
aa5
a31ac519ac6add30aea
nLi:n < i
iLn:i < n.+1 + k.+1

ade
aa5
a31ac519ac6add30aeaaf2af3
iH3:~~ (3 %| α n)

1 + 1 <= 1
aa5
a31ac519ac6add30aeaaf2af3af8a7e
aiE:α i = 2 ^ i1 * 3 ^ 0

af9
a31ac519ac6add30aeaaf2af3af8a83
aiE:α i = 2 ^ i1 * 3 ^ j1.+1
af9
aa6
a31ac519ac6add30aeaaf2af3af8a7eafe
i2:nat
anE:α n = 2 ^ i2 * 3 ^ 0

af9
a31ac519ac6add30aeaaf2af3af8a7eafe
i2, j2:nat
anE:α n = 2 ^ i2 * 3 ^ j2.+1
af9
b00aa6
a31ac519ac6add30aeaaf2af3af8
i1, i2:nat
aiE:α i = 2 ^ i1
anE:α n = 2 ^ i2

af9
b09
b11
α n < α i -> 1 + 1 <= 1
b09
a31ac519ac6add30aeaaf2af3af8b12b13b14
i2Li1:i2 < i1

af9
b09
b1c
α i < (α n).*2
b1c
α i < (α n).*2 -> 1 + 1 <= 1
b0ab00aa6
a31ac519add30aeaaf2af3af8b12b13b14b1d

α i <= α (n.+1 + k)
b22
a31ac519add30aeaaf2af8b12b13b14b1d
iLS:i < n.+1 + k

b29
b22
b1c
b24
b09
b0b
af9
aff
b01
af9
aa5
aa7
a61
528a5e17ca5fa60a69a72a95a9daa8
n1:=head 0 l:nat

a61
528a5e17ca5fa60a69a72a95a9daa8b3f
m1:=last 0 l:nat

a61
b43
sorted ltn l
528a5e17ca5fa60a69a72a95a9daa8b3fb44
lS:sorted ltn l
a61
b43
sorted (relpre [eta α] ltn) [seq i <- iota n (m - n).+1 | 3 %| α i]
b49
b43
transitive (relpre [eta α] ltn)
b43
sorted (relpre [eta α] ltn) (iota n (m - n).+1)
b4a
b43
b57
b49
528a5e17ca5fa60a69a72a95a9daa8b3fb44a8c
IH1:forall n : nat, sorted (relpre [eta α] ltn) (iota n k1)
n0:nat

path (relpre [eta α] ltn) n0 (iota n0.+1 k1)
b49
b4b
a61
528a5e17ca5fa60a69a72a95a9daa8b3fb44b4c
uS:uniq l

a61
b68
n1 \in l
528a5e17ca5fa60a69a72a95a9daa8b3fb44b4cb69
n1Il:n1 \in l
a61
b70
a61
528a5e17ca5fa60a69a72a95a9daa8b3fb44b4cb69b71
n2:nat
n2E:n1 = 3 * α n2

a61
b78
m1 \in l
528a5e17ca5fa60a69a72a95a9daa8b3fb44b4cb69b71b79b7a
m1Il:m1 \in l
a61
b81
a61
528a5e17ca5fa60a69a72a95a9daa8b3fb44b4cb69b71b79b7ab82
m2:nat
m2E:m1 = 3 * α m2

a61
b89
n1 < m1
528a5e17ca5fa60a69a72a95a9daa8b3fb44b4cb69b71b79b7ab82b8ab8b
n1Lm1:n1 < m1
a61
528a5e17ca5fa60a69a72a95a9db3fb44b69b71b79b7ab82b8ab8b5
l1:seq nat

a < b -> path ltn b l1 -> a < last b l1
b90
528a5e17ca5fa60a69a72a95a9db3fb44b69b71b79b7ab82b8ab8bf8b98
IH1:forall a b : nat, a < b -> path ltn b l1 -> a < last b l1
57
bLc:b < c
pH:path ltn c l1

a < last c l1
b90
b92
a61
b92
n2 < m2
528a5e17ca5fa60a69a72a95a9daa8b3fb44b4cb69b71b79b7ab82b8ab8bb93
n2Lm2:n2 < m2
a61
b89
α n2 < α m2 -> n2 < m2
ba9
528a5e17ca5fa60a69a72a95a9daa8b3fb44b4cb69b71b79b7ab82b8ab8b
m2Ln2:m2 < n2

α n2 < α m2 -> false
ba9
bab
a61
528a5e17ca5fa60a69a72a95a9daa8b3fb44b4cb69b71b79b7ab82b8ab8bb93bac
l1:=[seq 3 * α i | i <- iota n2 (m2 - n2).+1]:seq nat

a61
528a5e17ca5fa60a69a72a95a9daa8b3fb44b4cb69b71b79b7ab82b8ab8bb93bacbbe
l1size:size l1 = (m2 - n2).+1

a61
bc2
{subset l <= l1}
528a5e17ca5fa60a69a72a95a9daa8b3fb44b4cb69b71b79b7ab82b8ab8bb93bacbbebc3
H:{subset l <= l1}
a61
528a5e17ca5fa60a69a72a95a9daa8b3fb44b4cb69b71b79b7ab82b8ab8bb93bacbbebc330
iIl:i \in l
j:nat
jE:i = 3 * α j

i \in l1
bc8
bcf
n2 <= m2
bcf
n2 <= j < m2.+1
bc9
bcf
bda
bc8
bcf
n2 <= j
bcf
j <= m2
bc9
bcf
n1 <= i
bcf
n1 <= i -> n2 <= j
be3bc9
528a5e17ca5fa60a69a72a95a9db3fb44b69b71b79b7ab82b8ab8bb93bacbbebc330bd1bd2
a:nat
l2:seq nat

i \in a :: l2 -> path ltn a l2 -> a <= i
be9
bef
i \in l2 -> path ltn a l2 -> a <= i
be9
528a5e17ca5fa60a69a72a95a9db3fb44b69b71b79b7ab82b8ab8bb93bacbbebc330bd1bd2
b:nat
bf1
IH1:forall a : nat, i \in l2 -> path ltn a l2 -> a <= i
bf0

i \in b :: l2 -> (a < b) && path ltn b l2 -> a <= i
be9
528a5e17ca5fa60a69a72a95a9db3fb44b69b71b79b7ab82b8ab8bb93bacbbebc330bd1bd2bfbbf1bfcbf0
bIl2:i \in l2
7
pH:path ltn b l2

a <= i
be9
c01
b <= i
be9
bcf
beb
be2
528a5e17ca5fa60a69a72a95a9daa8b3fb44b4cb69b71b79b7ab82b8ab8bb93bacbbebc330bd0bd1bd2
jLn2:j < n2

α n2 <= α j -> false
be2
bcf
be4
bc8
bcf
i <= m1
bcf
i <= m1 -> j <= m2
bc9
bef
i \in a :: l2 -> path ltn a l2 -> i <= last a l2
c19
528a5e17ca5fa60a69a72a95a9db3fb44b69b71b79b7ab82b8ab8bb93bacbbebc330bd1bd2bfbbf1
IH1:forall a i : nat, i \in a :: l2 -> path ltn a l2 -> i <= last a l2
a, i1:nat

i1 \in [:: a, b & l2] -> (a < b) && path ltn b l2 -> i1 <= last b l2
c19
528a5e17ca5fa60a69a72a95a9db3fb44b69b71b79b7ab82b8ab8bb93bacbbebc330bd1bd2bfbbf1c24c257c03

a <= last b l2
528a5e17ca5fa60a69a72a95a9db3fb44b69b71b79b7ab82b8ab8bb93bacbbebc330bd1bd2bfbbf1c24c25
bIl2:i1 \in b :: l2
7c03
i1 <= last b l2
c1abc9
c2a
b \in b :: l2
c2c
c2e
c30
c19
bcf
c1b
bc8
528a5e17ca5fa60a69a72a95a9daa8b3fb44b4cb69b71b79b7ab82b8ab8bb93bacbbebc330bd0bd1bd2
jLn2:m2 < j

α j <= α m2 -> false
bc8
bca
a61
bca
k + n2 < m2
528a5e17ca5fa60a69a72a95a9daa8b3fb44b4cb69b71b79b7ab82b8ab8bb93bacbbebc3bcb
kn2Lm2:k + n2 < m2
a61
bca
k < m2 - n2
c48
c4a
a61
c4a
α n <= 3 * α n2
528a5e17ca5fa60a69a72a95a9daa8b3fb44b4cb69b71b79b7ab82b8ab8bb93bacbbebc3bcbc4b
anLan2:α n <= 3 * α n2
a61
c4a
α n <= n1
c57
528a5e17ca5fa60a69a72a95a9daa8b3fb44b4cb69b79b7ab82b8ab8bb93bacbbebc3bcbc4b58

i1 \in [seq i <- iota n (m - n).+1 | 3 %| α i] -> n1 = α i1 -> α n <= n1
c57
528a5e17ca5fa60a69a72a95a9daa8b3fb44b4cb69b79b7ab82b8ab8bb93bacbbebc3bcbc4b58
nLi1:n <= i1

α n <= α i1
c57
c59
a61
c59
3 * α m2 <= α m
528a5e17ca5fa60a69a72a95a9daa8b3fb44b4cb69b71b79b7ab82b8ab8bb93bacbbebc3bcbc4bc5a
am2Lam:3 * α m2 <= α m
a61
c59
m1 <= α m
c71
528a5e17ca5fa60a69a72a95a9daa8b3fb44b4cb69b71b79b7ab8ab8bb93bacbbebc3bcbc4bc5a58

i1 \in [seq i <- iota n (m - n).+1 | 3 %| α i] -> m1 = α i1 -> m1 <= α m
c71
528a5e17ca5fa60a69a72a95a9daa8b3fb44b4cb69b71b79b7ab8ab8bb93bacbbebc3bcbc4bc5a58
i1Lm:i1 < n + (m - n).+1

α i1 <= α m
c71
528a5e17ca5fa60a69a72a95a9daa8b3fb44b4cb69b71b79b7ab8ab8bb93bacbbebc3bcbc4bc5a58
i1Lm:i1 <= m

c83
c71
c73
a61
c73
α m2 < (α n2).*2
528a5e17ca5fa60a69a72a95a9daa8b3fb44b4cb69b71b79b7ab82b8ab8bb93bacbbebc3bcbc4bc5ac74
am2Lan2:α m2 < (α n2).*2
a61
c73
3 * α m2 < (3 * α n2).*2
c90
c59
α m < (3 * α n2).*2
c90
528a5e17ca5fa69a72a95a9daa8b3fb44b4cb69b71b79b7ab82b8ab8bb93bacbbebc3bcbc4bc5a

(α n).*2 <= (3 * α n2).*2
c90
c92
a61
528a5e17ca5fa60a69a72a95a9daa8b3fb44b4cb69b71b79b7ab82b8ab8bb93bacbbebc3bcbc4bc5ac93

3 ^ k.+1 + α n <= 3 * α m2
ca7
3 ^ k.+1 + 3 * α n2 <= 3 * α m2
ca7
3 ^ k + α n2 <= α m2
by apply: IH kn2Lm2 am2Lan2. Qed.
a30
3 ^ k <= α m -> α m + 3 ^ k <= α (m + k.+1)
cb2
a31
kLam:3 ^ k <= α m

a42
cb9
α m + minn (3 ^ k) (α m) <= α (m + k.+1) -> α m + 3 ^ k <= α (m + k.+1)
by rewrite (minn_idPl _). Qed.
8b1
{i : 'I_n.+1 | S_[l] n = (S1 i).*2 + l * ((3 ^ (n - i)).-1)./2}
cc0
by apply: eq_bigmin. Qed.

increasing S1
cc5
by move=> n; rewrite -leq_double; case: convex_2S1. Qed.
7af
~~ odd (3 ^ n).-1
cca
by rewrite -subn1 oddB ?expn_gt0 // oddX orbT. Qed. (* This is 3.4 *)
8b1
1 < l -> S_[l.+1] n.+1 <= S_[l] n + (α_[1] n).*2
ccf
8b2
l_gt1:1 < l

S_[l.+1] n.+1 <= S_[l] n + (α n).*2
8b2cd7
m:nat
mLn:m < n.+1
mH:S_[l] n = (S1 m).*2 + l * ((3 ^ (n - m)).-1)./2

cd8
8b2cd7cddcdf
mLn:m <= n

S_[l.+1] n.+1 <= (S1 m).*2 + l * ((3 ^ (n - m)).-1)./2 + (α n).*2
ce3
S_[l.+1] n.+1 <= (S1 m.+1).*2 + l.+1 * ((3 ^ (n - m)).-1)./2
ce3
(S1 m.+1).*2 + l.+1 * ((3 ^ (n - m)).-1)./2 <= (S1 m).*2 + l * ((3 ^ (n - m)).-1)./2 + (α n).*2
ce3
cec
ce3
(S1 m.+1).*2 + ((3 ^ (n - m)).-1)./2 <= (S1 m).*2 + (α n).*2
ce3
(S1 m.+1).*2 - (S1 m).*2 + ((3 ^ (n - m)).-1)./2 <= (α n).*2
ce3
(α m).*2 + ((3 ^ (n - m)).-1)./2 <= (α n).*2
8b2cd7cddcdf
mLn:m < n

cfb
cff
(α m).*2 + ((3 ^ (n - m)).-1)./2 <= (α m).*2 + (3 ^ (n - m).-1).*2
cff
(α m).*2 + (3 ^ (n - m).-1).*2 <= (α n).*2
cff
(((3 ^ (n - m)).-1)./2).*2 <= ((3 ^ (n - m).-1).*2).*2
d05
cff
(((3 ^ (n - m)).-1)./2).*2 <= (3 ^ (n - m)).-1
cff
(3 ^ (n - m)).-1 <= ((3 ^ (n - m).-1).*2).*2
d06
cff
d12
d05
cff
3 ^ (n - m) <= ((3 ^ (n - m).-1).*2).*2
d05
cff
d07
cff
α m + 3 ^ (n - m).-1 <= α n
cff
(3 ^ (n - m).-1 <= α m -> α m + 3 ^ (n - m).-1 <= α (m + (n - m).-1.+1)) -> α m + 3 ^ (n - m).-1 <= α n
cff
(3 ^ (n - m).-1 <= α m -> α m + 3 ^ (n - m).-1 <= α n) -> α m + 3 ^ (n - m).-1 <= α n
cff
3 ^ (n - m).-1 <= α m
cff
S_[l] n <= (S1 m.+1).*2 + l * ((3 ^ (n - m.+1)).-1)./2
cff
S_[l] n <= (S1 m.+1).*2 + l * ((3 ^ (n - m.+1)).-1)./2 -> 3 ^ (n - m).-1 <= α m
cff
d33
cff
S1 m.+1 = S1 m + α m
cff
(S1 m).*2 + l * ((3 ^ (n - m)).-1)./2 <= (S1 m + α m).*2 + l * ((3 ^ (n - m.+1)).-1)./2 -> 3 ^ (n - m).-1 <= α m
cff
d3d
cff
l * ((3 ^ (n - m)).-1)./2 <= (α m).*2 + l * ((3 ^ (n - m.+1)).-1)./2 -> 3 ^ (n - m).-1 <= α m
cff
l * (((3 ^ (n - m)).-1)./2 - ((3 ^ (n - m.+1)).-1)./2) <= (α m).*2 -> (3 ^ (n - m).-1).*2 <= (α m).*2
cff
l * ((3 ^ (n - m)).-1 - (3 ^ (n - m.+1)).-1)./2 <= (α m).*2 -> (3 ^ (n - m).-1).*2 <= (α m).*2
cff
(3 ^ (n - m)).-1 - (3 ^ (n - m.+1)).-1 = (3 ^ (n - m).-1).*2
cff
l * ((3 ^ (n - m).-1).*2)./2 <= (α m).*2 -> (3 ^ (n - m).-1).*2 <= (α m).*2
cff
3 ^ (n - m) - 3 ^ (n - m).-1 = (3 ^ (n - m).-1).*2
d51
cff
3 * 3 ^ (n - m).-1 - 3 ^ (n - m).-1 = (3 ^ (n - m).-1).*2
d51
cff
d53
by move=> /(leq_trans _)-> //; rewrite doubleK -mul2n leq_mul2r l_gt1 orbT. Qed.
8b1
S_[l] n.+1 = minn (S1 n.+1).*2 (S_[3 * l] n + l)
d60
8b1
minn (S1 n.+1).*2 (\min_(i <= n) ((S1 i).*2 + l * ((3 ^ (n.+1 - i)).-1)./2)) = minn (S1 n.+1).*2 (S_[3 * l] n + l)
8b1
\min_(i <= n) ((S1 i).*2 + l * ((3 ^ (n.+1 - i)).-1)./2) = S_[3 * l] n + l
8b1
\min_(i <= n) ((S1 i).*2 + l * ((3 ^ (n.+1 - i)).-1)./2) = \min_(i <= n) ((S1 i).*2 + 3 * l * ((3 ^ (n - i)).-1)./2 + l)
8d8
iH:i <= n

l * ((3 ^ (n.+1 - i)).-1)./2 = 3 * l * ((3 ^ (n - i)).-1)./2 + l
d73
((3 ^ (n.+1 - i)).-1)./2 = 3 * ((3 ^ (n - i)).-1)./2 + 1
d73
((3 ^ (n.+1 - i)).-1)./2 = (3 * (3 ^ (n - i)).-1)./2 + 2./2
d73
(3 ^ (n.+1 - i)).-1 = 3 * (3 ^ (n - i)).-1 + 2
d73
2 < (3 * 3 ^ (n - i)).+1
d73
2 < 3 * 3 ^ (n - i)
d73
d88
by rewrite -expnS (leq_exp2l 1). Qed. (* This is first part of 3.5 *)
7af
S_[1] n.+1 = (S_[3] n).+1
d8d
7af
S1 n.+1 = (S_[3] n).+1
7af
S_[1] n.+1 = minn (S1 n.+1).*2 (S_[3 * 1] n + 1) -> S1 n.+1 = (S_[3] n).+1
7af
S1 n.+1 == (S1 n.+1).*2 -> S1 n.+1 = (S_[3] n).+1
7af
0 == S1 n.+1 -> S1 n.+1 = (S_[3] n).+1
7af
0 < S1 n.+1
7af
cc7
by apply: increasing_dsum_alpha. Qed.
7af
α_[3] n = α_[1] n.+1
da9
by rewrite /alphaL /delta -subSS -!dsum_alpha3_S. Qed. (* This is second part of 3.5 *)
8b1
S_[l] n.+1 <= S_[3 * l] n + l
dae
8b1
minn (S1 n.+1).*2 (S_[3 * l] n + l) <= S_[3 * l] n + l
by apply: geq_minr. Qed.
8b1
S_[l] n + S_[l] n.+1 <= (S_[l.*2] n).*2 + l
db7
8b2
H:S_[l + l - l] n + S_[l + l + l] n <= (S_[l + l] n).*2

db9
8b2
H:S_[l] n + S_[(2 + 1) * l] n <= (S_[l.*2] n).*2

db9
dc3
S_[l] n + S_[l] n.+1 <= S_[l] n + S_[(2 + 1) * l] n + l
by rewrite -addnA leq_add2l dsum_alpha3l. Qed.
7af
S_[1] n + S_[1] n.+1 <= (S_[2] n).*2.+1
dca
by have := leq_dsum_alpha_2l_l 1 n; rewrite addn1. Qed. (* This is 3.7 *)
7af
3 < n -> 3 * α_[1] n.+1 <= 4 * α_[1] n
dcf
7af
3 < n -> 3 * α n.+1 <= 4 * α n
19
n_gt_3:3 < n

3 * α n.+1 <= 4 * α n
19ddb
an_gt_5:5 < α n

ddc
19ddbde137
anE:α n = 2 ^ i * 3 ^ 0

ddc
19ddbde1
i, j:nat
anE:α n = 2 ^ i * 3 ^ j.+1
ddc
19ddbde137
anE:α n = 2 ^ i

ddc
de7
19ddb37
anE:α n = 2 ^ i.+3
de1

ddc
de7
19ddb37df5de1
H1:8 * α n.+1 <= 9 * α n

ddc
df4
8 * α n.+1 <= 9 * α n
de8
df9
3 * 8 * α n.+1 <= 2 * 2 * 2 * 4 * α n
dfb
df9
3 * 8 * α n.+1 <= 3 * 9 * α n
df9
3 * 9 * α n <= 2 * 2 * 2 * 4 * α n
dfcde8
df9
e08
dfb
df4
dfd
de7
19ddb37df5de1
m:=2 ^ i * 3 ^ 2:nat

dfd
de7
19ddb37df5de1e13
m1:nat
m1H:α m1 = 2 ^ i * 3 ^ 2

dfd
de7
e17
α n < α m1
19ddb37df5de1e13e18e19
H2:α n < α m1
dfd
de8
e20
dfd
de7
e20
α n.+1 <= α m1
19ddb37df5de1e13e18e19e21
H3:α n.+1 <= α m1
dfd
de8
e20
α m1 <= α n -> α n.+1 <= α m1
e29
e2b
dfd
de7
e2b
(8 == 0) || (α n.+1 <= 2 ^ i * 9)
de7
de9
ddc
19ddbde1deadeb
m:=2 ^ i.+2 * 3 ^ j:nat

ddc
19ddbde1deadebe3fe18
m1H:α m1 = 2 ^ i.+2 * 3 ^ j

ddc
e43
e1d
19ddbde1deadebe3fe18e44e21
ddc
e43
3 ^ j * 3 < 2 * (2 * 3 ^ j)
e48
e4a
ddc
e4a
e28
19ddbde1deadebe3fe18e44e21e2c
ddc
e4a
e30
e55
e57
ddc
by rewrite anE !expnSr -[4]/(2 ^ 2) !mulnA -expnD add2n -m1H mulnC leq_mul2r. Qed.
7af
α_[1] n.+1 <= (α_[1] n).*2
e5f
7af
α n.+1 <= (α n).*2
9e1
α k.+1.+4 <= (α k.+4).*2
9e1
3 * α k.+1.+4 <= 3 * (α k.+4).*2
9e1
3 * α_[1] k.+1.+4 <= 3 * (α_[1] k.+4).*2
9e1
4 * α_[1] k.+4 <= 3 * (α_[1] k.+4).*2
by rewrite -mul2n mulnA leq_mul2r orbT. Qed.
7af
α_[1] n.+2 <= (α_[1] n).*2.+1
e78
7af
α n.+2 <= (α n).*2.+1
9e1
α k.+2.+4 <= (α k.+4).*2.+1
9e1
α_[1] k.+2.+4 <= (α_[1] k.+4).*2.+1
9e1
α_[1] k.+2.+4 <= (α_[1] k.+4).*2
9e1
3 * α_[1] k.+2.+4 <= 3 * (α_[1] k.+4).*2
9e1
4 * α_[1] k.+1.+4 <= 3 * (α_[1] k.+4).*2
9e1
3 * (4 * α_[1] k.+1.+4) <= 3 * (3 * (α_[1] k.+4).*2)
9e1
4 * (3 * α_[1] k.+1.+4) <= 4 * (4 * α_[1] k.+4)
9e1
4 * (4 * α_[1] k.+4) <= 3 * (3 * (α_[1] k.+4).*2)
9e1
e9e
by rewrite -mul2n !mulnA leq_mul2r orbT. Qed.
8b1
S_[l] n.+1 = S_[l] n + α_[l] n
ea3
by rewrite addnC subnK //; case: (convex_dsum_alphaL l). Qed.
8b1
S_[l] n = \sum_(i < n) α_[l] i
ea8
909
S_[l] 0 = \sum_(i < 0) α_[l] i
8b2
IH:S_[l] n = \sum_(i < n) α_[l] i
S_[l] n.+1 = \sum_(i < n.+1) α_[l] i
eb2
eb4
by rewrite dsum_alphaL_S IH big_ord_recr. Qed. (* Table *)

((S_[1] 0 = 0) * (S_[1] 1 = 1) * (S_[1] 2 = 3) * (S_[1] 3 = 6) * (S_[1] 4 = 10) * (S_[1] 5 = 16) * (S_[1] 6 = 24))%type
eb9
by rewrite /dsum_alphaL /conv /= /dsum_alpha -!(big_mkord xpredT) unlock /=; compute. Qed.

((S_[2] 0 = 0) * (S_[2] 1 = 2) * (S_[2] 2 = 4) * (S_[2] 3 = 8) * (S_[2] 4 = 14) * (S_[2] 5 = 20) * (S_[2] 6 = 28))%type
ebe
by rewrite /dsum_alphaL /conv /= /dsum_alpha -!(big_mkord xpredT) unlock /=; compute. Qed.

((S_[3] 0 = 0) * (S_[3] 1 = 2) * (S_[3] 2 = 5) * (S_[3] 3 = 9) * (S_[3] 4 = 15) * (S_[3] 5 = 23) * (S_[3] 6 = 32))%type
ec3
by rewrite /dsum_alphaL /conv /= /dsum_alpha -!(big_mkord xpredT) unlock /=; compute. Qed.

((S_[4] 0 = 0) * (S_[4] 1 = 2) * (S_[4] 2 = 6) * (S_[4] 3 = 10) * (S_[4] 4 = 16) * (S_[4] 5 = 24) * (S_[4] 6 = 36))%type
ec8
by rewrite /dsum_alphaL /conv /= /dsum_alpha -!(big_mkord xpredT) unlock /=; compute. Qed.

((S_[5] 0 = 0) * (S_[5] 1 = 2) * (S_[5] 2 = 6) * (S_[5] 3 = 11) * (S_[5] 4 = 17) * (S_[5] 5 = 25) * (S_[5] 6 = 37))%type
ecd
by rewrite /dsum_alphaL /conv /= /dsum_alpha -!(big_mkord xpredT) unlock /=; compute. Qed.

((α_[1] 0 = 1) * (α_[1] 1 = 2) * (α_[1] 2 = 3) * (α_[1] 3 = 4) * (α_[1] 4 = 6) * (α_[1] 5 = 8))%type
ed2
by rewrite /alphaL /delta !S1_small; compute. Qed.

((α_[2] 0 = 2) * (α_[2] 1 = 2) * (α_[2] 2 = 4) * (α_[2] 3 = 6) * (α_[2] 4 = 6) * (α_[2] 5 = 8))%type
ed7
by rewrite /alphaL /delta !S2_small; compute. Qed.

((α_[3] 0 = 2) * (α_[3] 1 = 3) * (α_[3] 2 = 4) * (α_[3] 3 = 6) * (α_[3] 4 = 8) * (α_[3] 5 = 9))%type
edc
by rewrite /alphaL /delta !S3_small; compute. Qed.

((α_[4] 0 = 2) * (α_[4] 1 = 4) * (α_[4] 2 = 4) * (α_[4] 3 = 6) * (α_[4] 4 = 8) * (α_[4] 5 = 12))%type
ee1
by rewrite /alphaL /delta !S4_small; compute. Qed.

((α_[5] 0 = 2) * (α_[5] 1 = 4) * (α_[5] 2 = 5) * (α_[5] 3 = 6) * (α_[5] 4 = 8) * (α_[5] 5 = 12))%type
ee6
by rewrite /alphaL /delta !S5_small; compute. Qed. Definition alphaS_small := (S1_small, S2_small, S3_small, S4_small, S5_small). Definition alpha_small := (alpha1_small, alpha2_small, alpha3_small, alpha4_small, alpha5_small). End S23. Notation α := (alpha 2 3). Notation "\min_ ( i <= n ) F" := (bigmin (fun i => F) n) (at level 41, F at level 41, i, n at level 50, format "\min_ ( i <= n ) F"). Notation " 'S_[' l ']' " := (dsum_alphaL l) (format "S_[ l ]"). Notation " 'α_[' l ']' " := (alphaL l) (format "α_[ l ]"). Notation S1 := dsum_alpha.