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.
(******************************************************************************)
(*                                                                            *)
(*                                    PSI                                     *)
(*     psi n = the psi function                                               *)
(*                                                                            *)
(*                                                                            *)
(*                                                                            *)
(******************************************************************************)

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]
New coercion path [GRing.subring_closedM; GRing.smulr_closedN] : GRing.subring_closed >-> GRing.oppr_closed is ambiguous with existing [GRing.subring_closedB; GRing.zmod_closedN] : GRing.subring_closed >-> GRing.oppr_closed. [ambiguous-paths,typechecker]
New coercion path [GRing.subring_closed_semi; GRing.semiring_closedM] : GRing.subring_closed >-> GRing.mulr_closed is ambiguous with existing [GRing.subring_closedM; GRing.smulr_closedM] : GRing.subring_closed >-> GRing.mulr_closed. New coercion path [GRing.subring_closed_semi; GRing.semiring_closedD] : GRing.subring_closed >-> GRing.addr_closed is ambiguous with existing [GRing.subring_closedB; GRing.zmod_closedD] : GRing.subring_closed >-> GRing.addr_closed. [ambiguous-paths,typechecker]
New coercion path [GRing.sdivr_closed_div; GRing.divr_closedM] : GRing.sdivr_closed >-> GRing.mulr_closed is ambiguous with existing [GRing.sdivr_closedM; GRing.smulr_closedM] : GRing.sdivr_closed >-> GRing.mulr_closed. [ambiguous-paths,typechecker]
New coercion path [GRing.subalg_closedBM; GRing.subring_closedB] : GRing.subalg_closed >-> GRing.zmod_closed is ambiguous with existing [GRing.subalg_closedZ; GRing.submod_closedB] : GRing.subalg_closed >-> GRing.zmod_closed. [ambiguous-paths,typechecker]
New coercion path [GRing.divring_closed_div; GRing.sdivr_closedM] : GRing.divring_closed >-> GRing.smulr_closed is ambiguous with existing [GRing.divring_closedBM; GRing.subring_closedM] : GRing.divring_closed >-> GRing.smulr_closed. New coercion path [GRing.divring_closed_div; GRing.sdivr_closedM; GRing.smulr_closedN] : GRing.divring_closed >-> GRing.oppr_closed is ambiguous with existing [GRing.divring_closedBM; GRing.subring_closedB; GRing.zmod_closedN] : GRing.divring_closed >-> GRing.oppr_closed. [ambiguous-paths,typechecker]
New coercion path [GRing.divalg_closedBdiv; GRing.divring_closedBM] : GRing.divalg_closed >-> GRing.subring_closed is ambiguous with existing [GRing.divalg_closedZ; GRing.subalg_closedBM] : GRing.divalg_closed >-> GRing.subring_closed. New coercion path [GRing.divalg_closedBdiv; GRing.divring_closedBM; GRing.subring_closedB] : GRing.divalg_closed >-> GRing.zmod_closed is ambiguous with existing [GRing.divalg_closedZ; GRing.subalg_closedZ; GRing.submod_closedB] : GRing.divalg_closed >-> GRing.zmod_closed. [ambiguous-paths,typechecker]
New coercion path [GRing.Pred.subring_smul; GRing.Pred.smul_mul] : GRing.Pred.subring >-> GRing.Pred.mul is ambiguous with existing [GRing.Pred.subring_semi; GRing.Pred.semiring_mul] : GRing.Pred.subring >-> GRing.Pred.mul. [ambiguous-paths,typechecker]
New coercion path [GRing.Pred.divring_sdiv; GRing.Pred.sdiv_smul; GRing.Pred.smul_mul] : GRing.Pred.divring >-> GRing.Pred.mul is ambiguous with existing [GRing.Pred.divring_ring; GRing.Pred.subring_semi; GRing.Pred.semiring_mul] : GRing.Pred.divring >-> GRing.Pred.mul. [ambiguous-paths,typechecker]
From hanoi Require Import extra triangular phi. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Open Scope fset_scope. Open Scope nat_scope. Section BigFSetAux. Variable (R : Type) (idx : R) (op : Monoid.com_law idx). Variable (I J : choiceType).
R:Type
idx:R
op:Monoid.com_law idx
I, J:choiceType
e:{fset I}
a:nat

\sum_(i <- e) a = #|` e| * a
2
by rewrite big_const_seq count_predT iter_addn_0 mulnC. Qed.
56789

e != fset0 -> {i : I | i \in e}
e
by case: e => [] [|i l] iH //=; exists i; rewrite inE eqxx. Qed. (* Should be reworked *)
56789
F:I -> nat

0 < #|` e| -> {i0 : I | i0 \in e /\ \max_(i <- e) F i = F i0}
14
567817
n:nat
IH:forall e : {fset I}, #|` e| < n -> 0 < #|` e| -> {i0 : I | i0 \in e /\ \max_(i <- e) F i = F i0}
9
cI:#|` e| < n.+1

18
5678171e1f920
i:I
iH:i \in e

{i0 : I | i0 \in e /\ \max_(i <- e) F i = F i0}
24
#|` e `\ i| <= 0 -> {i0 : I | i0 \in e /\ \max_(i1 <- e) F i1 = F i0}
5678171e1f9202526
H:0 < #|` e `\ i|
27
5678171e1f9202526
eZ:e `\ i = fset0

27
2c
33
\max_(i <- e) F i = F i
2c
33
maxn (F i) 0 = F i
2c
2e
27
2e
#|` e `\ i| < n
5678171e1f92025262f
j:I
jIe:j \in e `\ i
jH:\max_(i <- e `\ i) F i = F j
27
46
27
5678171e1f92025262f474849
FiLFj:F i <= F j

27
5678171e1f92025262f474849
FjLFi:F j < F i
27
50
j \in e
50
\max_(i <- e) F i = F j
53
50
5c
52
50
maxn (F i) (F j) = F j
52
54
27
54
i \in e
5438
54
38
54
maxn (F i) (F j) = F i
by apply/maxn_idPl/ltnW. Qed.
5678
a:I
A:{fset I}
P:pred I
F:I -> R

a \in A -> P a -> \big[op/idx]_(i <- A | P i) F i = op (F a) (\big[op/idx]_(i <- A `\ a | P i) F i)
75
567878797a7b
aA:a \in A
aP:P a

op (\big[op/idx]_(i <- [fset x | x in A & mem [fset a] x] | P i) F i) (\big[op/idx]_(i <- [fset x | x in A & ~~ mem [fset a] x] | P i) F i) = op (F a) (\big[op/idx]_(i <- A `\ a | P i) F i)
81
\big[op/idx]_(i <- [fset x | x in A & ~~ mem [fset a] x] | P i) F i = \big[op/idx]_(i <- A `\ a | P i) F i
81
\big[op/idx]_(i <- [fset x | x in A & mem [fset a] x] | P i) F i = F a
81
8b
81
\big[op/idx]_(i <- [fset a] | P i) F i = F a
81
[fset H | H in mem_fin (fset_finpred A) & mem [fset a] H] = [fset a]
81
\big[op/idx]_(x <- [:: [` fset11 a]] | P (fsval x)) F (fsval x) = F a
93
81
95
by apply/fsetP=> i; rewrite !inE /= andbC; case: eqP => //->. Qed. End BigFSetAux. Section BigFSetAux. Variable (R : Type) (idx : R) (op : Monoid.com_law idx). Variable (I J : choiceType).
56787a
m:nat
917

reflect (forall i : I, i \in e -> P i -> F i <= m) (\max_(i <- e | P i) F i <= m)
9e
56787aa1917
leFm:\max_(i <- e | P i) F i <= m
25
iIe:i \in e
Pi:P i

F i <= m
56787aa1917
leFm:forall i : I, i \in e -> P i -> F i <= m
\max_(i <- e | P i) F i <= m
56787aa191725a9aa

\max_(i <- e | P i) F i <= m -> F i <= m
ac
b4
F i <= maxn (F i) (\max_(i <- e `\ i | P i) F i)
ac
ae
b0
ae
\max_(i <- e | (i \in e) && P i) F i <= m
56787aa1917af
m1, m2:nat
m1Lm:m1 <= m
m2Ln:m2 <= m

maxn m1 m2 <= m
56787aa1917af25
i \in e -> P i -> F i <= m
cb
cc
by apply: leFm. Qed.
567891725

i \in e -> F i <= \max_(i <- e) F i
d1
567891725a9

F i <= \max_(i <- e) F i
d9
d4
567891725a978
l:seq I
IH:i \in l -> F i <= \max_(i <- l) F i

i \in a :: l -> F i <= \max_(i <- (a :: l)) F i
567891725a978e2e3
H:F i <= \max_(i <- l) F i

F i <= maxn (F a) (\max_(j <- l) F j)
by apply: leq_trans H _; apply: leq_maxr. Qed. End BigFSetAux. Section PsiDef. Implicit Type e : {fset nat}. Import Order.TTheory GRing.Theory Num.Theory. Open Scope fset_scope. Definition psi_aux l e : int := ((2 ^ l).-1 + (\sum_(i <- e) 2 ^ (minn (troot i) l)))%:R - (l * 2 ^ l)%:R. Notation "'ψ'' n" := (psi_aux n) (format "'ψ'' n", at level 0).
e:{fset nat}

(0 <= ψ'(0) e)%R
ec
by rewrite /psi_aux add0n mul0n subr0 (ler_nat _ 0). Qed.
l:nat
e1, e2:{fset nat}

e1 `<=` e2 -> (ψ'(l) e1 <= ψ'(l) e2)%R
f3
f6f7
e1Se2:e1 `<=` e2

(ψ'(l) e1 <= ψ'(l) e2)%R
fd
(((2 ^ l).-1 + \sum_(i <- e1) 2 ^ minn (∇i) l)%:R <= ((2 ^ l).-1 + \sum_(i <- e2) 2 ^ minn (∇i) l)%:R)%R
fd
(2 ^ l).-1 + \sum_(i <- e1) 2 ^ minn (∇i) l <= (2 ^ l).-1 + \sum_(i <- e2) 2 ^ minn (∇i) l
fd
\sum_(i <- e1) 2 ^ minn (∇i) l <= \sum_(i <- e2) 2 ^ minn (∇i) l
fd
\sum_(i <- e1) 2 ^ minn (∇i) l <= \sum_(i <- e2 | i \in e1) 2 ^ minn (∇i) l + \sum_(i <- e2 | i \notin e1) 2 ^ minn (∇i) l
f6f7fe
iH:[fset x | x in e1 & true] =i [fset i | i in e2 & i \in e1]

10f
fd
[fset x | x in e1 & true] =i [fset i | i in e2 & i \in e1]
fd
117
f6f7fe
i:nat_choiceType

(i \in [eta mem_seq e1]) && true = (i \in [eta mem_seq e2]) && (i \in e1)
11e
(i \in e1 -> i \in e2) -> (i \in [eta mem_seq e1]) && true = (i \in [eta mem_seq e2]) && (i \in e1)
by case: (i \in e1) => [->//|]; rewrite andbF. Qed.
f6ef

ψ'(l) e = (((2 ^ l * #|` [fset i in e | (l <= ∇i)%N]|.+1).-1 + \sum_(i <- e | (∇i < l)%N) 2 ^ ∇i)%:R - (l * 2 ^ l)%:R)%R
126
128
(((2 ^ l).-1 + \sum_(i <- e) 2 ^ minn (∇i) l)%:R - (l * 2 ^ l)%:R)%R = (((2 ^ l * #|` [fset i | i in e & (l <= ∇i)%N]|.+1).-1 + \sum_(i <- e | (∇i < l)%N) 2 ^ ∇i)%:R - (l * 2 ^ l)%:R)%R
128
((2 ^ l).-1 + \sum_(i <- e) 2 ^ minn (∇i) l)%N = ((2 ^ l * #|` [fset i | i in e & l <= ∇i]|.+1).-1 + \sum_(i <- e | ∇i < l) 2 ^ ∇i)%N
128
((2 ^ l).-1 + (\sum_(i <- [fset x | x in e & l <= ∇x]) 2 ^ minn (∇i) l + \sum_(i <- [fset x | x in e & ~~ (l <= ∇x)]) 2 ^ minn (∇i) l))%N = ((2 ^ l * #|` [fset i | i in e & l <= ∇i]|.+1).-1 + \sum_(i <- e | ∇i < l) 2 ^ ∇i)%N
128
forall x : nat, x \in [fset x0 | x0 in e & l <= ∇x0] -> true -> 2 ^ minn (∇x) l = 2 ^ l
128
((2 ^ l).-1 + (\sum_(i <- [fset x | x in e & l <= ∇x]) 2 ^ l + \sum_(i <- [fset x | x in e & ~~ (l <= ∇x)]) 2 ^ minn (∇i) l))%N = ((2 ^ l * #|` [fset i | i in e & l <= ∇i]|.+1).-1 + \sum_(i <- e | ∇i < l) 2 ^ ∇i)%N
128
13d
128
((2 ^ l).-1 + (#|` [fset x | x in e & l <= ∇x]| * 2 ^ l + \sum_(i <- [fset x | x in e & ~~ (l <= ∇x)]) 2 ^ minn (∇i) l))%N = ((2 ^ l * #|` [fset i | i in e & l <= ∇i]|.+1).-1 + \sum_(i <- e | ∇i < l) 2 ^ ∇i)%N
128
forall x : nat, x \in [fset x0 | x0 in e & ~~ (l <= ∇x0)] -> true -> 2 ^ minn (∇x) l = 2 ^ ∇x
128
((2 ^ l).-1 + (#|` [fset x | x in e & l <= ∇x]| * 2 ^ l + \sum_(i <- [fset x | x in e & ~~ (l <= ∇x)]) 2 ^ ∇i))%N = ((2 ^ l * #|` [fset i | i in e & l <= ∇i]|.+1).-1 + \sum_(i <- e | ∇i < l) 2 ^ ∇i)%N
f6ef
i:nat
H:~~ (l <= ∇i)

2 ^ minn (∇i) l = 2 ^ ∇i
149
14f
∇i <= l
149
128
14b
128
((2 ^ l).-1 + #|` [fset x | x in e & l <= ∇x]| * 2 ^ l)%N = (2 ^ l * #|` [fset i | i in e & l <= ∇i]|.+1).-1
128
\sum_(i <- [fset x | x in e & ~~ (l <= ∇x)]) 2 ^ ∇i = \sum_(i <- e | ∇i < l) 2 ^ ∇i
128
((2 ^ l).-1 + #|` [fset x | x in e & l <= ∇x]| * 2 ^ l)%N = (2 ^ l + #|` [fset i | i in e & l <= ∇i]| * 2 ^ l).-1
15e
128
160
by apply: eq_fbigl_cond => i; rewrite !inE ltnNge andbT. Qed.
128
ψ'(l) e = (((2 ^ l * #|` [fset i in e | (l < ∇i)%N]|.+1).-1 + \sum_(i <- e | (∇i <= l)%N) 2 ^ ∇i)%:R - (l * 2 ^ l)%:R)%R
169
128
(((2 ^ l).-1 + \sum_(i <- e) 2 ^ minn (∇i) l)%:R - (l * 2 ^ l)%:R)%R = (((2 ^ l * #|` [fset i | i in e & (l < ∇i)%N]|.+1).-1 + \sum_(i <- e | (∇i <= l)%N) 2 ^ ∇i)%:R - (l * 2 ^ l)%:R)%R
128
((2 ^ l).-1 + \sum_(i <- e) 2 ^ minn (∇i) l)%N = ((2 ^ l * #|` [fset i | i in e & l < ∇i]|.+1).-1 + \sum_(i <- e | ∇i <= l) 2 ^ ∇i)%N
128
((2 ^ l).-1 + (\sum_(i <- [fset x | x in e & l < ∇x]) 2 ^ minn (∇i) l + \sum_(i <- [fset x | x in e & ~~ (l < ∇x)]) 2 ^ minn (∇i) l))%N = ((2 ^ l * #|` [fset i | i in e & l < ∇i]|.+1).-1 + \sum_(i <- e | ∇i <= l) 2 ^ ∇i)%N
128
forall x : nat, x \in [fset x0 | x0 in e & l < ∇x0] -> true -> 2 ^ minn (∇x) l = 2 ^ l
128
((2 ^ l).-1 + (\sum_(i <- [fset x | x in e & l < ∇x]) 2 ^ l + \sum_(i <- [fset x | x in e & ~~ (l < ∇x)]) 2 ^ minn (∇i) l))%N = ((2 ^ l * #|` [fset i | i in e & l < ∇i]|.+1).-1 + \sum_(i <- e | ∇i <= l) 2 ^ ∇i)%N
128
17f
128
((2 ^ l).-1 + (#|` [fset x | x in e & l < ∇x]| * 2 ^ l + \sum_(i <- [fset x | x in e & ~~ (l < ∇x)]) 2 ^ minn (∇i) l))%N = ((2 ^ l * #|` [fset i | i in e & l < ∇i]|.+1).-1 + \sum_(i <- e | ∇i <= l) 2 ^ ∇i)%N
128
forall x : nat, x \in [fset x0 | x0 in e & ~~ (l < ∇x0)] -> true -> 2 ^ minn (∇x) l = 2 ^ ∇x
128
((2 ^ l).-1 + (#|` [fset x | x in e & l < ∇x]| * 2 ^ l + \sum_(i <- [fset x | x in e & ~~ (l < ∇x)]) 2 ^ ∇i))%N = ((2 ^ l * #|` [fset i | i in e & l < ∇i]|.+1).-1 + \sum_(i <- e | ∇i <= l) 2 ^ ∇i)%N
f6ef150
H:~~ (l < ∇i)

152
18b
191
156
18b
128
18d
128
((2 ^ l).-1 + #|` [fset x | x in e & l < ∇x]| * 2 ^ l)%N = (2 ^ l * #|` [fset i | i in e & l < ∇i]|.+1).-1
128
\sum_(i <- [fset x | x in e & ~~ (l < ∇x)]) 2 ^ ∇i = \sum_(i <- e | ∇i <= l) 2 ^ ∇i
128
((2 ^ l).-1 + #|` [fset x | x in e & l < ∇x]| * 2 ^ l)%N = (2 ^ l + #|` [fset i | i in e & l < ∇i]| * 2 ^ l).-1
19d
128
19f
by apply: eq_fbigl_cond => i; rewrite !inE ltnNge andbT negbK. Qed. Definition psi_auxb e := (maxn #|`e| (\max_(i <- e) troot i)).+1. Notation "'ψ_b' n" := (psi_auxb n) (format "'ψ_b' n", at level 0).
128
ψ_b(e) <= l -> (ψ'(l) e <= 0)%R
1a8
eff6

maxn #|` e| (\max_(i <- e) ∇i) < l.+1 -> (ψ'(l.+1) e <= 0)%R
eff6
eLl:#|` e| <= l
maxLl:\max_(i <- e) ∇i <= l

(((2 ^ l.+1).-1 + \sum_(i <- e) 2 ^ minn (∇i) l.+1)%:R - (l.+1 * 2 ^ l.+1)%:R <= 0)%R
1b4
(((2 ^ l.+1).-1 + \sum_(i <- e) 2 ^ minn (∇i) l.+1)%:R - ((2 ^ l.+1).-1 + (l * 2 ^ l.+1).+1)%:R <= 0)%R
1b4
((\sum_(i <- e) 2 ^ minn (∇i) l.+1)%:R - (l * 2 ^ l.+1).+1%:R <= 0)%R
1b4
\sum_(i <- e) 2 ^ minn (∇i) l.+1 <= (l * 2 ^ l.+1).+1
1b4
\sum_(i <- e) 2 ^ minn (∇i) l.+1 <= l * 2 ^ l.+1
1b4
#|` e| * 2 ^ l.+1 <= l * 2 ^ l.+1
1b4
\sum_(i <- e) 2 ^ minn (∇i) l.+1 <= #|` e| * 2 ^ l.+1
1b4
1ce
1b4
\sum_(i <- e) 2 ^ minn (∇i) l.+1 <= \sum_(i <- e) 2 ^ l.+1
eff61b51b611f
iIe:true

2 ^ minn (∇i) l.+1 <= 2 ^ l.+1
1d9
minn (∇i) l.+1 <= l.+1
by apply geq_minr. Qed. Definition rnz (z : int) := `|Num.max 0%R z|.
z:int_numDomainType

(z <= 0)%R -> rnz z = 0
1e1
by move=> zN; rewrite /rnz max_l. Qed.
1e3
(0 <= z)%R -> z = ((rnz z)%:R)%R
1e8
by move=> zP; rewrite /rnz max_r // natz gez0_abs. Qed.
z:int_porderType

(z <= rnz z)%R
1ed
by rewrite /rnz; case: ler0P => //= zP; rewrite gtz0_abs. Qed.
z1, z2:int_porderType

(z1 <= z2)%R -> rnz z1 <= rnz z2
1f4
1f7
z1_gt0:(0 < z1)%R
z1Lz2:(z1 <= z2)%R

(z2 <= 0)%R -> `|z1| <= 0
1f71fe1ff
z2_gt0:(0 < z2)%R
`|z1| <= `|z2|
203
205
by rewrite -lez_nat !gtz0_abs. Qed. Definition psi e := \max_(l < psi_auxb e) rnz (psi_aux l e). Notation "'ψ' n" := (psi n) (format "'ψ' n", at level 0).
ef1e

ψ_b(e) <= n -> ψ(e) = \max_(l < n) rnz (ψ'(l) e)
20a
ef1e
pLn:ψ_b(e) <= n

ψ(e) = \max_(l < n) rnz (ψ'(l) e)
212
\max_(l < ψ_b(e)) rnz (ψ'(l) e) = \max_(l < n) rnz (ψ'(l) e)
212
\max_(i < n | true && (i < ψ_b(e))) rnz (ψ'(i) e) = \max_(l < n) rnz (ψ'(l) e)
212
\max_(i < n | i < ψ_b(e)) rnz (ψ'(i) e) = maxn (\max_(i < n | i < ψ_b(e)) rnz (ψ'(i) e)) (\max_(i < n | ~~ (i < ψ_b(e))) rnz (ψ'(i) e))
ef1e213
i:'I_n

~~ (i < ψ_b(e)) -> rnz (ψ'(i) e) = 0
224
(ψ'(i) e <= 0)%R -> rnz (ψ'(i) e) = 0
exact: rnz_ler0. Qed.
1af
(ψ'(l) e <= ψ(e)%:R)%R
22c
eff6
n:=maxn ψ_b(e) l.+1:nat

22e
233
(ψ'(l) e <= (\max_(l < n) rnz (ψ'(l) e))%:R)%R
eff6234
O:l < n

238
23c
(0 <= (\max_(l < n) rnz (ψ'(l) e))%:R)%R
23c
((rnz (ψ'(l) e))%:R <= (\max_(l < n) rnz (ψ'(l) e))%:R)%R
23c
244
23c
rnz (ψ'(l) e) <= \max_(l < n) rnz (ψ'(l) e)
by rewrite (bigD1 (Ordinal O)) //= leq_maxl. Qed.
128
(((2 ^ l).-1 + \sum_(i <- e) 2 ^ minn (∇i) l)%:R - (l * 2 ^ l)%:R <= (ψ(e)%:R : int))%R
24d
128
(0 <= ψ(e)%:R)%R
f6ef
lLp:l < ψ_b(e)
(((2 ^ l).-1 + \sum_(i <- e) 2 ^ minn (∇i) l)%:R - (l * 2 ^ l)%:R <= ψ(e)%:R)%R
257
259
257
(((2 ^ l).-1 + \sum_(i <- e) 2 ^ minn (∇i) l)%:R - (l * 2 ^ l)%:R <= (maxn (rnz (ψ'(l) e)) (\max_(i < ψ_b(e) | i != Ordinal lLp) rnz (ψ'(i) e)))%:R)%R
257
(rnz (((2 ^ l).-1 + \sum_(i <- e) 2 ^ minn (∇i) l)%:R - (l * 2 ^ l)%:R) <= (maxn (rnz (ψ'(l) e)) (\max_(i < ψ_b(e) | i != Ordinal lLp) rnz (ψ'(i) e)))%:R)%R
257
rnz (((2 ^ l).-1 + \sum_(i <- e) 2 ^ minn (∇i) l)%:R - (l * 2 ^ l)%:R) <= maxn (rnz (ψ'(l) e)) (\max_(i < ψ_b(e) | i != Ordinal lLp) rnz (ψ'(i) e))
apply: leq_maxl. Qed.
ee
{l : nat | (ψ(e)%:R)%R = ψ'(l) e}
26a
ee
{l : 'I_ψ_b(e) | ψ(e) = rnz (ψ'(l) e)}
ef
l:'I_ψ_b(e)
ψ(e) = rnz (ψ'(l) e) -> {l : nat | (ψ(e)%:R)%R = ψ'(l) e}
ee
0 < #|ordinal_finType ψ_b(e)|
272
274
276
ef275
pP:(0 < ψ'(l) e)%R

{l0 : nat | (`|ψ'(l) e|%:R)%R = ψ'(l0) e}
ef275
pG:(ψ'(l) e <= 0)%R
pE:ψ(e) = `|0%R|
26c
286
26c
by exists 0; apply/eqP; rewrite eq_le {1}pE psi_aux_0_ge0 psi_max. Qed.
f7

e1 `<=` e2 -> ψ(e1) <= ψ(e2)
28d
f7fe

ψ(e1) <= ψ(e2)
295
\max_(l < maxn ψ_b(e1) ψ_b(e2)) rnz (ψ'(l) e1) <= ψ(e2)
295
\max_(l < maxn ψ_b(e1) ψ_b(e2)) rnz (ψ'(l) e1) <= \max_(l < maxn ψ_b(e2) ψ_b(e1)) rnz (ψ'(l) e2)
295
\max_(l < maxn ψ_b(e2) ψ_b(e1)) rnz (ψ'(l) e1) <= \max_(l < maxn ψ_b(e2) ψ_b(e1)) rnz (ψ'(l) e2)
f7fe
x1, x2, y1, y2:nat
x2Lx1:x2 <= x1
y2Ly1:y2 <= y1

maxn x2 y2 <= maxn x1 y1
f7fe
i:ordinal_finType (maxn ψ_b(e2) ψ_b(e1))
rnz (ψ'(i) e1) <= rnz (ψ'(i) e2)
2a6
true && (y2 <= maxn x1 y1)
2ab
2ad
2af
2ad
(ψ'(i) e1 <= ψ'(i) e2)%R
by apply: psi_aux_sub. Qed.
28f
(forall l : nat, (ψ'(l) e1 <= ψ'(l) e2)%R) -> ψ(e1) <= ψ(e2)
2bc
f7
H:forall l : nat, (ψ'(l) e1 <= ψ'(l) e2)%R

296
f72c4
e:=maxn ψ_b(e1) ψ_b(e2):nat

296
2c8
\max_(l < e) rnz (ψ'(l) e1) <= ψ(e2)
2c8
\max_(l < e) rnz (ψ'(l) e1) <= \max_(l < e) rnz (ψ'(l) e2)
f72c4
e:nat
IH:\max_(l < e) rnz (ψ'(l) e1) <= \max_(l < e) rnz (ψ'(l) e2)

\max_(l < e.+1) rnz (ψ'(l) e1) <= \max_(l < e.+1) rnz (ψ'(l) e2)
by rewrite !big_ord_recr /= geq_max !leq_max IH /= rnz_ler // orbT. Qed.
1e

ψ_b(`[n]) = n.+1
2da
2dc
maxn #|` `[n]| (\max_(i <- `[n]) ∇i) = n
2e0
2dc
maxn n (\max_(i <- `[n]) ∇i) = n
2dc
maxn n (\max_(i <- `[n]) ∇i) == n
2dc
\max_(i <- `[n]) ∇i <= n
1e11f
iLn:i < n

∇i <= n
by apply: leq_trans (leq_rootnn _) (ltnW _). Qed.
n, l:nat

ψ'(l) `[n] = (((2 ^ l).-1 + \sum_(0 <= i < n) 2 ^ minn (∇i) l)%:R - (l * 2 ^ l)%:R)%R
2f7
2f9
\sum_(i <- `[n]) 2 ^ minn (∇i) l = \sum_(0 <= i < n) 2 ^ minn (∇i) l
l, n:nat
IH:\sum_(i <- `[n]) 2 ^ minn (∇i) l = \sum_(0 <= i < n) 2 ^ minn (∇i) l

\sum_(i <- `[n.+1]) 2 ^ minn (∇i) l = \sum_(0 <= i < n.+1) 2 ^ minn (∇i) l
304
(2 ^ minn (∇n) l + \sum_(i <- `[n.+1] `\ n) 2 ^ minn (∇i) l)%N = \sum_(0 <= i < n.+1) 2 ^ minn (∇i) l
by rewrite sintSr IH !big_mkord big_ord_recr /= addnC. Qed.

ψ_b(fset0) = 1
30d
by rewrite /psi_auxb cardfs0 max0n big_seq_cond big1. Qed.

ψ(fset0) = 0
312

\max_(l < 1) rnz (ψ'(l) fset0) = 0

rnz (ψ'(0) fset0) = 0
by rewrite /psi_aux /= big_seq_cond big1. Qed.
ee
(ψ(e) == 0) = (e == fset0)
31f
ef
x:nat_choiceType

x \in e -> (ψ(e) == 0) = (e == fset0)
326
x \in e -> (ψ(e) == 0) = false
ef327
xIe:x \in e

(ψ(e) == 0) = false
330
0 < ψ(e)
330
(0%:R < ψ(e)%:R)%R
330
(0%:R < ψ'(0) e)%R
by rewrite /psi_aux add0n subr0 ltr_nat (big_fsetD1 x). Qed.

ψ(`[0]) = 0
340
by rewrite sint0_set0 psi_set0. Qed.

ψ(`[1]) = 1
345

\max_(l < 2) rnz (ψ'(l) `[1]) = 1

\max_(0 <= i < 2) rnz (ψ'(i) `[1]) = 1
f:=fun l : nat => rnz (((2 ^ l).-1 + \sum_(0 <= i < 1) 2 ^ minn (∇i) l)%:R - (l * 2 ^ l)%:R):nat -> nat

350
354
\max_(0 <= i < 2) f i = 1
by rewrite /f /= unlock. Qed.

ψ(`[2]) = 2
35b

\max_(l < 3) rnz (ψ'(l) `[2]) = 2

\max_(0 <= i < 3) rnz (ψ'(i) `[2]) = 2
f:=fun l : nat => rnz (((2 ^ l).-1 + \sum_(0 <= i < 2) 2 ^ minn (∇i) l)%:R - (l * 2 ^ l)%:R):nat -> nat

366
36a
\max_(0 <= i < 3) f i = 2
by rewrite /f /= unlock. Qed.

ψ(`[3]) = 4
371

\max_(l < 4) rnz (ψ'(l) `[3]) = 4

\max_(0 <= i < 4) rnz (ψ'(i) `[3]) = 4
f:=fun l : nat => rnz (((2 ^ l).-1 + \sum_(0 <= i < 3) 2 ^ minn (∇i) l)%:R - (l * 2 ^ l)%:R):nat -> nat

37c
380
\max_(0 <= i < 4) f i = 4
by rewrite /f /= unlock. Qed.
2f9
l < (∇n).-1 -> (ψ'(l) `[n] <= ψ'(l.+1) `[n])%R
387
2fa
lLr:l < (∇n).-1

(ψ'(l) `[n] <= ψ'(l.+1) `[n])%R
38e
Δl.+2 <= n
2fa38f
dlLn:Δl.+2 <= n
390
38e
0 < ∇n - l.+1
395
397
390
397
(((2 ^ l * #|` [fset i | i in `[n] & (l < ∇i)%N]|.+1).-1 + \sum_(i <- `[n] | (∇i <= l)%N) 2 ^ ∇i)%:R - (l * 2 ^ l)%:R <= ((2 ^ l.+1 * #|` [fset i | i in `[n] & (l < ∇i)%N]|.+1).-1 + \sum_(i <- `[n] | (∇i < l.+1)%N) 2 ^ ∇i)%:R - (l.+1 * 2 ^ l.+1)%:R)%R
2fa38f398
s:=\sum_(H <- `[n] | ∇H <= l) 2 ^ ∇H:nat

(((2 ^ l * #|` [fset i | i in `[n] & (l < ∇i)%N]|.+1).-1 + s)%:R - (l * 2 ^ l)%:R <= ((2 ^ l.+1 * #|` [fset i | i in `[n] & (l < ∇i)%N]|.+1).-1 + s)%:R - (l.+1 * 2 ^ l.+1)%:R)%R
3a7
[fset i | i in `[n] & l < ∇i] = [fset i | i in `[n] & Δl.+1 <= i]
3a7
(((2 ^ l * #|` [fset i | i in `[n] & (Δl.+1 <= i)%N]|.+1).-1 + s)%:R - (l * 2 ^ l)%:R <= ((2 ^ l.+1 * #|` [fset i | i in `[n] & (Δl.+1 <= i)%N]|.+1).-1 + s)%:R - (l.+1 * 2 ^ l.+1)%:R)%R
3a7
3b0
3a7
(((2 ^ l * #|` sint (Δl.+1) n|.+1).-1 + s)%:R - (l * 2 ^ l)%:R <= ((2 ^ l.+1 * #|` sint (Δl.+1) n|.+1).-1 + s)%:R - (l.+1 * 2 ^ l.+1)%:R)%R
3a7
(((2 ^ l * (n - Δl.+1).+1).-1 + s)%:R - (l * 2 ^ l)%:R <= ((2 ^ l.+1 * (n - Δl.+1).+1).-1 + s)%:R - (l.+1 * 2 ^ l.+1)%:R)%R
2fa38f3983a8
c:=n - Δl.+1:nat

(((2 ^ l * c.+1).-1 + s)%:R - (l * 2 ^ l)%:R <= ((2 ^ l.+1 * c.+1).-1 + s)%:R - (l.+1 * 2 ^ l.+1)%:R)%R
3bf
(((2 ^ l * c.+1).-1 + s)%:R - (l * 2 ^ l)%:R <= ((2 ^ l * (2 * c.+1)).-1 + s)%:R - (l.+1 * (2 * 2 ^ l))%:R)%R
3bf
(((2 ^ l * c.+1).-1 + s)%:R - (l * 2 ^ l)%:R <= ((2 ^ l * (c.+1 + c.+1)).-1 + s)%:R - ((l.+2 + l) * 2 ^ l)%:R)%R
3bf
(((2 ^ l * c.+1).-1 + s)%:R - (l * 2 ^ l)%:R <= (2 ^ l * c.+1 + (2 ^ l * c.+1).-1 + s)%:R - (l.+2 * 2 ^ l + l * 2 ^ l)%:R)%R
2fa38f3983a83c0
x:=2 ^ l * c.+1:nat

((x.-1 + s)%:R - (l * 2 ^ l)%:R <= (x + x.-1 + s)%:R - (l.+2 * 2 ^ l + l * 2 ^ l)%:R)%R
3d1
((x.-1 + s)%:R - (l * 2 ^ l)%:R <= (x.-1 + s + x)%:R - (l.+2 * 2 ^ l + l * 2 ^ l)%:R)%R
3d1
((x.-1 + s)%:R <= (x.-1 + s + x)%:R - (l.+2 * 2 ^ l)%:R)%R
3d1
((l.+2 * 2 ^ l)%:R <= x%:R)%R
3d1
l.+2 * 2 ^ l <= x
3d1
(2 ^ l == 0) || (l.+1 < c.+1)
3d1
Δl.+1 <= n
3d1
(2 ^ l == 0) || (l.+1 < n.+1 - Δl.+1)
3d1
394
3ec
3d1
3ee
by rewrite ltn_subRL -addnS -deltaS (leq_trans dlLn) ?orbT. Qed.
2f9
(∇n).-1 <= l -> (ψ'(l.+1) `[n] <= ψ'(l) `[n])%R
3f6
2fa
rLl:(∇n).-1 <= l

(ψ'(l.+1) `[n] <= ψ'(l) `[n])%R
3fd
n < Δl.+2
2fa3fe
dlLn:n < Δl.+2
3ff
3fd
~~ (0 < ∇n - l.+1)
404
406
3ff
406
(((2 ^ l.+1 * #|` [fset i | i in `[n] & (l < ∇i)%N]|.+1).-1 + \sum_(i <- `[n] | (∇i < l.+1)%N) 2 ^ ∇i)%:R - (l.+1 * 2 ^ l.+1)%:R <= ψ'(l) `[n])%R
406
(((2 ^ l.+1 * #|` [fset i | i in `[n] & (l < ∇i)%N]|.+1).-1 + \sum_(i <- `[n] | (∇i < l.+1)%N) 2 ^ ∇i)%:R - (l.+1 * 2 ^ l.+1)%:R <= ((2 ^ l * #|` [fset i | i in `[n] & (l < ∇i)%N]|.+1).-1 + \sum_(i <- `[n] | (∇i <= l)%N) 2 ^ ∇i)%:R - (l * 2 ^ l)%:R)%R
2fa3fe407
s:=\sum_(H <- `[n] | ∇H < l.+1) 2 ^ ∇H:nat

(((2 ^ l.+1 * #|` [fset i | i in `[n] & (l < ∇i)%N]|.+1).-1 + s)%:R - (l.+1 * 2 ^ l.+1)%:R <= ((2 ^ l * #|` [fset i | i in `[n] & (l < ∇i)%N]|.+1).-1 + s)%:R - (l * 2 ^ l)%:R)%R
41a
3ad
41a
(((2 ^ l.+1 * #|` [fset i | i in `[n] & (Δl.+1 <= i)%N]|.+1).-1 + s)%:R - (l.+1 * 2 ^ l.+1)%:R <= ((2 ^ l * #|` [fset i | i in `[n] & (Δl.+1 <= i)%N]|.+1).-1 + s)%:R - (l * 2 ^ l)%:R)%R
41a
422
41a
(((2 ^ l.+1 * #|` sint (Δl.+1) n|.+1).-1 + s)%:R - (l.+1 * 2 ^ l.+1)%:R <= ((2 ^ l * #|` sint (Δl.+1) n|.+1).-1 + s)%:R - (l * 2 ^ l)%:R)%R
41a
(((2 ^ l.+1 * (n - Δl.+1).+1).-1 + s)%:R - (l.+1 * 2 ^ l.+1)%:R <= ((2 ^ l * (n - Δl.+1).+1).-1 + s)%:R - (l * 2 ^ l)%:R)%R
2fa3fe40741b3c0

(((2 ^ l.+1 * c.+1).-1 + s)%:R - (l.+1 * 2 ^ l.+1)%:R <= ((2 ^ l * c.+1).-1 + s)%:R - (l * 2 ^ l)%:R)%R
431
(((2 ^ l * (2 * c.+1)).-1 + s)%:R - (l.+1 * (2 * 2 ^ l))%:R <= ((2 ^ l * c.+1).-1 + s)%:R - (l * 2 ^ l)%:R)%R
431
(((2 ^ l * (c.+1 + c.+1)).-1 + s)%:R - ((l.+2 + l) * 2 ^ l)%:R <= ((2 ^ l * c.+1).-1 + s)%:R - (l * 2 ^ l)%:R)%R
431
((2 ^ l * c.+1 + (2 ^ l * c.+1).-1 + s)%:R - (l.+2 * 2 ^ l + l * 2 ^ l)%:R <= ((2 ^ l * c.+1).-1 + s)%:R - (l * 2 ^ l)%:R)%R
2fa3fe40741b3c03d2

((x + x.-1 + s)%:R - (l.+2 * 2 ^ l + l * 2 ^ l)%:R <= (x.-1 + s)%:R - (l * 2 ^ l)%:R)%R
442
((x.-1 + s + x)%:R - (l.+2 * 2 ^ l + l * 2 ^ l)%:R <= (x.-1 + s)%:R - (l * 2 ^ l)%:R)%R
442
((x.-1 + s + x)%:R - (l.+2 * 2 ^ l)%:R <= (x.-1 + s)%:R)%R
442
(x%:R <= (l.+2 * 2 ^ l)%:R)%R
442
x <= l.+2 * 2 ^ l
442
(2 ^ l == 0) || (c < l.+2)
442
(2 ^ l == 0) || (c < Δl.+2 - Δl.+1)
442
Δl.+1 < Δl.+1 + l.+2
by rewrite addnS ltnS leq_addr. Qed.
2dc
(ψ(`[n])%:R)%R = ψ'((∇n).-1) `[n]
461
2dc
(ψ(`[n])%:R)%R == ψ'((∇n).-1) `[n]
2dc
(ψ(`[n])%:R <= ψ'((∇n).-1) `[n])%R
2f9
(ψ'(l) `[n] <= ψ'((∇n).-1) `[n])%R
2fa
E:(∇n).-1 <= l

470
2fa
E:l < (∇n).-1
470
474
(ψ'(l - (∇n).-1 + (∇n).-1) `[n] <= ψ'((∇n).-1) `[n])%R
476
2fa475
k:nat
IH:(ψ'(k + (∇n).-1) `[n] <= ψ'((∇n).-1) `[n])%R

(ψ'(k.+1 + (∇n).-1) `[n] <= ψ'((∇n).-1) `[n])%R
476
2fa475482

(ψ'(k.+1 + (∇n).-1) `[n] <= ψ'(k + (∇n).-1) `[n])%R
476
488
(ψ'((k + (∇n).-1).+1) `[n] <= ψ'(k + (∇n).-1) `[n])%R
476
488
(∇n).-1 <= k + (∇n).-1
476
478
470
478
(ψ'((∇n).-1 - ((∇n).-1 - l)) `[n] <= ψ'((∇n).-1) `[n])%R
478
(ψ'((∇n).-1 - 0) `[n] <= ψ'((∇n).-1) `[n])%R
2fa479482
IH:(ψ'((∇n).-1 - k) `[n] <= ψ'((∇n).-1) `[n])%R
(ψ'((∇n).-1 - k.+1) `[n] <= ψ'((∇n).-1) `[n])%R
49f
4a1
2fa479482

(ψ'((∇n).-1 - k.+1) `[n] <= ψ'((∇n).-1 - k) `[n])%R
4a8
(ψ'(((∇n).-1 - k).-1) `[n] <= ψ'((∇n).-1 - k) `[n])%R
4a8
(∇n).-1 <= k -> (ψ'(((∇n).-1 - k).-1) `[n] <= ψ'((∇n).-1 - k) `[n])%R
2fa479482
E1:k < (∇n).-1
4ad
4b4
4ad
4b4
(ψ'(((∇n).-1 - k).-1) `[n] <= ψ'(((∇n).-1 - k).-1.+1) `[n])%R
4b4
((∇n).-1 - k).-1 < (∇n).-1
2fa479
u, k:nat

(u.+1 - k.+1).-1 < u.+1
4c4
(u.+1 - k.+1).-1 < u.+1.-1.+1
by rewrite ltnS -!subn1 leq_sub2r // leq_subr. Qed. (* This is 2.2 *)
2dc
ψ(`[n]).*2 = ϕ(n.+1).-1
4cc
1e
nP:0 < n

4ce
4d3
(ψ(`[n]).*2%:R)%R == (ϕ(n.+1).-1%:R)%R
4d3
(ψ(`[n])%:R *+ 2)%R == (ϕ(n.+1).-1%:R)%R
4d3
((((2 ^ (∇n).-1 * #|` [fset i | i in `[n] & ((∇n).-1 < ∇i)%N]|.+1).-1 + \sum_(i <- `[n] | (∇i <= (∇n).-1)%N) 2 ^ ∇i)%:R - ((∇n).-1 * 2 ^ (∇n).-1)%:R) *+ 2)%R == (ϕ(n.+1).-1%:R)%R
4d3
[fset H | H in mem_fin (fset_finpred `[n]) & (∇n).-1 < ∇H] = [fset i | i in `[n] & Δ(∇n) <= i]
4d3
((((2 ^ (∇n).-1 * #|` [fset i | i in `[n] & (Δ(∇n) <= i)%N]|.+1).-1 + \sum_(i <- `[n] | (∇i <= (∇n).-1)%N) 2 ^ ∇i)%:R - ((∇n).-1 * 2 ^ (∇n).-1)%:R) *+ 2)%R == (ϕ(n.+1).-1%:R)%R
1e4d411f

((∇n).-1 < ∇i) = (Δ(∇n) <= i)
4e5
4d3
4e7
4d3
((((2 ^ (∇n).-1 * (n - Δ(∇n)).+1).-1 + \sum_(i <- `[n] | (∇i <= (∇n).-1)%N) 2 ^ ∇i)%:R - ((∇n).-1 * 2 ^ (∇n).-1)%:R) *+ 2)%R == (ϕ(n.+1).-1%:R)%R
4d3
\sum_(i <- `[n] | ∇i <= (∇n).-1) 2 ^ ∇i = ϕ(Δ(∇n))
4d3
((((2 ^ (∇n).-1 * (n - Δ(∇n)).+1).-1 + ϕ(Δ(∇n)))%:R - ((∇n).-1 * 2 ^ (∇n).-1)%:R) *+ 2)%R == (ϕ(n.+1).-1%:R)%R
4d3
\sum_(i <- `[n] | ∇i <= (∇n).-1) 2 ^ ∇i = \sum_(i < Δ(∇n)) 2 ^ ∇i
4f8
4d3
xpredT =1 (fun i : 'I_(Δ(∇n)) => i \in `[n])
4d3
\sum_(i <- `[n] | ∇i <= (∇n).-1) 2 ^ ∇i = \sum_(i < Δ(∇n) | i \in `[n]) 2 ^ ∇i
4f9
1e4d4
i:'I_(Δ(∇n))

true = (i \in `[n])
503
4d3
505
4f8
4d3
\sum_(i <- [::] | ∇i <= (∇n).-1) 2 ^ ∇i = \sum_(i < Δ(∇n) | i \in [::]) 2 ^ ∇i
1e4d4a
l:seq nat
IH:uniq l -> \sum_(i <- l | ∇i <= (∇n).-1) 2 ^ ∇i = \sum_(i < Δ(∇n) | i \in l) 2 ^ ∇i
aNIl:a \notin l
lU:uniq l
\sum_(i <- (a :: l) | ∇i <= (∇n).-1) 2 ^ ∇i = \sum_(i < Δ(∇n) | i \in a :: l) 2 ^ ∇i
4f9
515
51a
4f8
1e4d4a516517518519
aLb:(∇n).-1 < ∇a

\sum_(i < Δ(∇n) | i \in l) 2 ^ ∇i = \sum_(i < Δ(∇n) | i \in a :: l) 2 ^ ∇i
1e4d4a516517518519
aLb:∇a <= (∇n).-1
(2 ^ ∇a + \sum_(i < Δ(∇n) | i \in l) 2 ^ ∇i)%N = \sum_(i < Δ(∇n) | i \in a :: l) 2 ^ ∇i
4f9
1e4d4a516517518519
aLb:∇n <= ∇a

523
524
1e4d4a51651751851952d50a

(i \in l) = (i <= a) && ~~ (i < a) || (i \in l)
524
526
528
4f8
526
a < Δ(∇n)
1e4d4a516517518519527
aLn:a < Δ(∇n)
528
4f9
53c
528
4f8
53c
(2 ^ ∇a + \sum_(i < Δ(∇n) | i \in l) 2 ^ ∇i)%N = (2 ^ ∇a + \sum_(i < Δ(∇n) | (i \in a :: l) && (i != Ordinal aLn)) 2 ^ ∇i)%N
4f8
53c
\sum_(i < Δ(∇n) | i \in l) 2 ^ ∇i = \sum_(i < Δ(∇n) | (i \in a :: l) && (i != Ordinal aLn)) 2 ^ ∇i
4f8
1e4d4a51651751851952753d50a

(i \in l) = ((i == a) || (i \in l)) && (i != a)
4f8
4d3
4fa
1e4d4
m:=∇n:nat

((((2 ^ m.-1 * (n - Δm).+1).-1 + ϕ(Δm))%:R - (m.-1 * 2 ^ m.-1)%:R) *+ 2)%R == (ϕ(n.+1).-1%:R)%R
554
((((2 ^ m.-1 * (tmod n).+1).-1 + ϕ(Δm))%:R - (m.-1 * 2 ^ m.-1)%:R) *+ 2)%R == (ϕ(n.+1).-1%:R)%R
1e4d4555
p:=tmod n:nat

((((2 ^ m.-1 * p.+1).-1 + ϕ(Δm))%:R - (m.-1 * 2 ^ m.-1)%:R) *+ 2)%R == (ϕ(n.+1).-1%:R)%R
55e
((((2 ^ m.-1 * p.+1).-1 + (1 + m * 2 ^ m - 2 ^ m))%:R - (m.-1 * 2 ^ m.-1)%:R) *+ 2)%R == (ϕ(n.+1).-1%:R)%R
(* taking care of m * 2 ^ m - 2 ^ m *)
55e
((((2 ^ m.-1 * p.+1).-1 + (1 + m.-1.+1 * 2 ^ m - 2 ^ m))%:R - (m.-1 * 2 ^ m.-1)%:R) *+ 2)%R == (ϕ(n.+1).-1%:R)%R
55e
((((2 ^ m.-1 * p.+1).-1 + (m.-1 * 2 ^ m).+1)%:R - (m.-1 * 2 ^ m.-1)%:R) *+ 2)%R == (ϕ(n.+1).-1%:R)%R
55e
0 < 2 ^ m.-1 * p.+1
55e
(((2 ^ m.-1 * p.+1 + m.-1 * 2 ^ m)%:R - (m.-1 * 2 ^ m.-1)%:R) *+ 2)%R == (ϕ(n.+1).-1%:R)%R
55e
573
(* taking care of m.-1 * 2 ^ m - m.-1 * 2 ^ m.-1 *)
55e
(((2 ^ m.-1 * p.+1 + m.-1 * 2 ^ m.-1.+1)%:R - (m.-1 * 2 ^ m.-1)%:R) *+ 2)%R == (ϕ(n.+1).-1%:R)%R
55e
((2 ^ m.-1 * p.+1 + m.-1 * 2 ^ m.-1)%:R *+ 2)%R == (ϕ(n.+1).-1%:R)%R
55e
(((p + m) * 2 ^ m.-1)%:R *+ 2)%R == (ϕ(n.+1).-1%:R)%R
55e
((p + m) * 2 ^ m.-1).*2 == ϕ(n.+1).-1
55e
((p + m) * 2 ^ m.-1).*2 == (1 + (m + p) * 2 ^ m).-1
55e
((m + p) * 2 ^ m.-1).*2 == (m + p) * 2 ^ m.-1.+1
by rewrite expnS mulnCA mul2n. Qed.
a, b:nat

a <= b -> ψ(`[a]) <= ψ(`[b])
590
593
aLb:a <= b
11f

i \in `[a] -> i \in `[b]
by rewrite !mem_sint /= => iLa; apply: leq_trans aLb. Qed.
2dc
ψ(`[n.+1]) = (ψ(`[n]) + 2 ^ (∇n.+1).-1)%N
59d
1e
F:0 < ϕ(n.+1)

59f
5a4
ψ(`[n.+1]).*2 = (ψ(`[n]).*2 + (2 ^ (∇n.+1).-1).*2)%N
5a4
ϕ(n.+2).-1 = (ϕ(n.+1).-1 + (2 ^ (∇n.+1).-1).*2)%N
5a4
ϕ(n.+2).-1 = (ϕ(n.+1).-1 + 2 ^ ∇n.+1)%N
by rewrite phiE big_ord_recr -phiE prednDl. Qed. (* This is 2.2 *)
592
ψ(`[a + b]) <= ψ(`[a]).*2 + 2 ^ b.-1
5b3
592
ψ(`[a + b.+1]) <= ψ(`[a]).*2 + 2 ^ b.+1.-1
592
ψ(`[a + b.+1]).*2 <= (ψ(`[a]).*2).*2 + (2 ^ b).*2
592
ϕ(a.+1 + b.+1) <= ((ϕ(a.+1).-1).*2 + (2 ^ b).*2).+1
592
ϕ(a.+1).*2 + (2 ^ b.+1).-1 <= ((ϕ(a.+1).-1).*2 + (2 ^ b).*2).+1
592
(ϕ(a.+1).-1).*2.+2 + (2 ^ b.+1).-1 <= ((ϕ(a.+1).-1).*2 + (2 ^ b).*2).+1
by rewrite expnS mul2n -prednDr ?double_gt0 ?expn_gt0. Qed. (* This is 2.3 *)
2dc
2 ^ (∇n).+1 <= ψ(`[n.+2])
5cc
2dc
2 ^ (∇n.+1).+1 <= ψ(`[n.+3])
2dc
(Δ(∇n.+1)).+1 < n.+3
2dc
2 ^ (∇n.+1).+1 <= ψ(`[(Δ(∇n.+1)).+2])
2dc
5da
1e
s:=∇n.+1:nat

2 ^ s.+1 <= ψ(`[(Δs).+2])
5e1
s <= 1 -> 2 ^ s.+1 <= ψ(`[(Δs).+2])
1e5e2
tLs:1 < s
5e3
2dc
0 < 1 -> 2 ^ 2 <= ψ(`[(Δ1).+2])
5e8
5ea
5e3
5ea
(2 ^ s.+1).*2 <= (1 + (∇(Δs).+2 + tmod (Δs).+2) * 2 ^ ∇(Δs).+2).-1
5ea
∇(Δs).+2 = s
1e5e25eb
tE:∇(Δs).+2 = s
5f6
5fd
5f6
5fd
(2 ^ s.+1).*2 <= (1 + (s + tmod (Δs).+2) * 2 ^ s).-1
5fd
(2 ^ s.+1).*2 <= (1 + (s + 2) * 2 ^ s).-1
by rewrite -mul2n expnS mulnA /= leq_mul2r (leq_add2r 2 2) tLs orbT. Qed.
2dc
ψ'(0) `[n] = n
60b
2dc
((\sum_(i <- `[n]) 2 ^ minn (∇i) 0)%:R)%R = n
2dc
\sum_(i <- `[n]) 2 ^ minn (∇i) 0 = n
2dc
\sum_(i <- `[n]) 1 = n
1e11f
2 ^ minn (∇i) 0 = 1
61d
61e
by rewrite minn0. Qed. (* This is 2.4.1 *)
2dc
n <= ψ(`[n])
623
2dc
(n%:R <= ψ(`[n])%:R)%R
2dc
(ψ'(0) `[n] <= ψ(`[n])%:R)%R
by apply: psi_max. Qed.
F:nat -> nat
1e

\sum_(i <- `[n]) F i = \sum_(i < n) F i
630
632
\sum_(i <- `[n] | (i \in `[n]) && true) F i = \sum_(i < n) F i
632
(fun i : nat => (i \in `[n]) && true) =1 (fun i : nat => i < n)
632
\sum_(i <- `[n] | i < n) F i = \sum_(i < n) F i
632
640
632
xpredT =1 (fun i : 'I_n => i \in `[n])
632
\sum_(i <- `[n] | i < n) F i = \sum_(i < n | i \in `[n]) F i
632
64a
632
\sum_(i <- [::] | i < n) F i = \sum_(i < n | i \in [::]) F i
633
n, a:nat
516
IH:uniq l -> \sum_(i <- l | i < n) F i = \sum_(i < n | i \in l) F i
518519
\sum_(i <- (a :: l) | i < n) F i = \sum_(i < n | i \in a :: l) F i
654
657
633655516656518519
aLn:~~ (a < n)

\sum_(i < n | i \in l) F i = \sum_(i < n | i \in a :: l) F i
633655516656518519
aLn:a < n
(F a + \sum_(i < n | i \in l) F i)%N = \sum_(i < n | i \in a :: l) F i
63365551665651851965f225

a < n -> (a \in l) = true || (a \in l)
661
663
665
663
(F a + \sum_(i < n | i \in l) F i)%N = (F a + \sum_(i < n | (i \in a :: l) && (i != Ordinal aLn)) F i)%N
663
\sum_(i < n | i \in l) F i = \sum_(i < n | (i \in a :: l) && (i != Ordinal aLn)) F i
633655516656518519664225

54d
by case: (_ =P _); rewrite ?andbT // => ->; rewrite (negPf aNIl). Qed.
ee
#|` e|.-1 <= \max_(i <- e) i
67b
IH:forall e, #|` e| < 0 -> #|` e|.-1 <= \max_(i <- e) i
ef
cI:#|` e| < 1

67d
1e
IH:forall e, #|` e| < n.+1 -> #|` e|.-1 <= \max_(i <- e) i
ef
cI:#|` e| < n.+2
67d
687
67d
1e688ef

#|` e|.+1 < n.+2 -> #|` e|.-1 <= \max_(i <- e) i
1e688ef
eC:#|` e|.+1 = n.+2
67d
694
67d
1e688ef695150a9
iM:\max_(i <- e) i = i

67d
1e688ef695150a969d
eE:#|` e| = #|` e `\ i|.+1

67d
1e688ef695150a969d6a2
H:#|` e `\ i|.-1 <= \max_(i <- e `\ i) i

67d
6a6
#|` e `\ i| <= \max_(i <- e) i
1e688ef695150a969d6a26a7482
eIE:#|` e `\ i| = k.+1

k < \max_(i <- e) i
1e688ef695150a969d6a26a74826b0
j:nat_choiceType

j \in e `\ i -> \max_(i <- e `\ i) i = j -> k < \max_(i <- e) i
1e688ef695150a969d6a26a74826b06b6
jDi:j != i
jIe:j \in e
jM:\max_(i <- e `\ i) i = j

6b1
1e688ef695150a969d6a24826b06b66bc6bd6be
H:k.+1.-1 <= \max_(i <- e `\ i) i

6b1
1e688ef695150a969d6a24826b06b66bc6bd6be

j < i
6c7
j <= i -> j < i
by rewrite leq_eqVlt (negPf jDi). Qed.
128
(ψ'(l) `[#|` e|] <= ψ'(l) e)%R
6ce
128
\sum_(i <- `[#|` e|]) 2 ^ minn (∇i) l <= \sum_(i <- e) 2 ^ minn (∇i) l
128
\sum_(i < #|` e|) 2 ^ minn (∇i) l <= \sum_(i <- e) 2 ^ minn (∇i) l
f6
IH:forall e, #|` e| < 0 -> \sum_(i < #|` e|) 2 ^ minn (∇i) l <= \sum_(i <- e) 2 ^ minn (∇i) l
ef684

6d9
305
IH:forall e, #|` e| < n.+1 -> \sum_(i < #|` e|) 2 ^ minn (∇i) l <= \sum_(i <- e) 2 ^ minn (∇i) l
ef689
6d9
6e1
6d9
3056e2ef

#|` e|.+1 < n.+2 -> \sum_(i < #|` e|) 2 ^ minn (∇i) l <= \sum_(i <- e) 2 ^ minn (∇i) l
3056e2ef
eC:#|` e| = n.+1
6d9
6ed
6d9
3056e2ef6ee150a969d

6d9
3056e2ef6ee150a969d6a2

6d9
6f9
2 ^ minn (∇#|` e `\ i|) l + \sum_(i0 < #|` e `\ i|) 2 ^ minn (∇i0) l <= 2 ^ minn (∇i) l + \sum_(i <- e `\ i) 2 ^ minn (∇i) l
6f9
2 ^ minn (∇#|` e `\ i|) l <= 2 ^ minn (∇i) l
6f9
minn (∇#|` e `\ i|) l <= ∇i
6f9
∇#|` e `\ i| <= ∇i
6f9
#|` e `\ i| <= i
6f9
#|` e|.-1 < (\max_(i <- e) i).+1
by apply: max_set_nat. Qed. (* This is 2.4.2 *)
ee
ψ(`[#|` e|]) <= ψ(e)
713
1af
6d0
by apply: psi_aux_card_le. Qed. (* This is 2.4.3 *)
ee
ψ(e) <= (2 ^ #|` e|).-1
71b
ee
(ψ(e)%:R <= (2 ^ #|` e|).-1%:R)%R
1af
(ψ'(l) e <= (2 ^ #|` e|).-1%:R)%R
1af
(ψ'(l) e <= ((2 ^ l).-1 + \sum_(i <- e) 2 ^ l)%:R - (l * 2 ^ l)%:R)%R
1af
(((2 ^ l).-1 + \sum_(i <- e) 2 ^ l)%:R - (l * 2 ^ l)%:R <= (2 ^ #|` e|).-1%:R)%R
1af
(((2 ^ l).-1 + \sum_(i <- e) 2 ^ minn (∇i) l)%:R <= ((2 ^ l).-1 + \sum_(i <- e) 2 ^ l)%:R)%R
72b
1af
\sum_(i <- e) 2 ^ minn (∇i) l <= \sum_(i <- e) 2 ^ l
72b
eff611f
Hi:true

2 ^ minn (∇i) l <= 2 ^ l
72b
1af
72d
1af
(2 ^ l).-1 + #|` e| * 2 ^ l <= l * 2 ^ l + (2 ^ #|` e|).-1
1af
(2 ^ l + #|` e| * 2 ^ l).-1 <= (l * 2 ^ l + 2 ^ #|` e|).-1
1af
2 ^ l + #|` e| * 2 ^ l <= l * 2 ^ l + 2 ^ #|` e|
eff6
E:#|` e| <= l

74a
eff6
E:l < #|` e|
74a
74e
2 ^ (l - #|` e| + #|` e|) + #|` e| * 2 ^ (l - #|` e| + #|` e|) <= (l - #|` e| + #|` e|) * 2 ^ (l - #|` e| + #|` e|) + 2 ^ #|` e|
750
eff674f
u:=l - #|` e|:nat

2 ^ (u + #|` e|) + #|` e| * 2 ^ (u + #|` e|) <= (u + #|` e|) * 2 ^ (u + #|` e|) + 2 ^ #|` e|
750
75b
2 ^ u * 2 ^ #|` e| <= u * (2 ^ u * 2 ^ #|` e|) + 2 ^ #|` e|
750
eff674f
u:nat

2 ^ u.+1 * 2 ^ #|` e| <= u.+1 * (2 ^ u.+1 * 2 ^ #|` e|) + 2 ^ #|` e|
750
752
74a
752
2 ^ l + (#|` e| - l + l) * 2 ^ l <= l * 2 ^ l + 2 ^ (#|` e| - l + l)
eff6753
u:=#|` e| - l:nat

2 ^ l + (u + l) * 2 ^ l <= l * 2 ^ l + 2 ^ (u + l)
772
2 ^ l + u * 2 ^ l <= 2 ^ u * 2 ^ l
by rewrite -mulSn leq_mul2r ltn_expl // orbT. Qed. (* This is 2.5 *)
28f
ψ(e1) - ψ(e2) <= \sum_(i <- e1 `\` e2) 2 ^ ∇i
77a
28f
(ψ(e1)%:R - ψ(e2)%:R <= (\sum_(i <- e1 `\` e2) 2 ^ ∇i)%:R)%R
f7f6

(ψ'(l) e1 - ψ(e2)%:R <= (\sum_(i <- e1 `\` e2) 2 ^ ∇i)%:R)%R
785
(ψ'(l) e1 - ψ'(l) e2 <= (\sum_(i <- e1 `\` e2) 2 ^ ∇i)%:R)%R
785
((\sum_(i <- e1) 2 ^ minn (∇i) l)%:R - (\sum_(i <- e2) 2 ^ minn (∇i) l)%:R <= (\sum_(i <- e1 `\` e2) 2 ^ ∇i)%:R)%R
785
\sum_(i <- e1) 2 ^ minn (∇i) l - \sum_(i <- e2) 2 ^ minn (∇i) l <= \sum_(i <- e1 `\` e2) 2 ^ ∇i
f7f6
s1:=\sum_(H <- e1) 2 ^ minn (∇H) l:nat
s2:=\sum_(H <- e2) 2 ^ minn (∇H) l:nat
s3:=\sum_(H <- e1 `\` e2) 2 ^ ∇H:nat

s1 - s2 <= s3
f7f6797798799
f:=fun i : nat => 2 ^ minn (∇i) l:nat -> nat

79a
79e
\sum_(i <- e1 `\` e2) f i <= s3
79e
s1 - s2 <= \sum_(i <- e1 `\` e2) f i
79e
7a6
79e
s1 <= s2 + \sum_(i <- e1 `\` e2) f i
79e
\sum_(i <- [fset x | x in e1 & x \in e2]) 2 ^ minn (∇i) l + \sum_(i <- [fset x | x in e1 & x \notin e2]) 2 ^ minn (∇i) l <= s2 + \sum_(i <- e1 `\` e2) f i
79e
\sum_(i <- [fset x | x in e1 & x \in e2]) 2 ^ minn (∇i) l <= s2
79e
\sum_(i <- [fset x | x in e1 & x \notin e2]) 2 ^ minn (∇i) l <= \sum_(i <- e1 `\` e2) f i
79e
\sum_(i <- [fset x | x in e1 & x \in e2]) 2 ^ minn (∇i) l <= \sum_(i <- [fset x | x in e2 & x \in e1]) 2 ^ minn (∇i) l + \sum_(i <- [fset x | x in e2 & x \notin e1]) 2 ^ minn (∇i) l
7b6
79e
\sum_(i <- [fset x | x in e1 & x \in e2]) 2 ^ minn (∇i) l <= \sum_(i <- [fset x | x in e2 & x \in e1]) 2 ^ minn (∇i) l
7b6
79e
\sum_(i <- [fset x | x in e1 & x \in e2]) 2 ^ minn (∇i) l = \sum_(i <- [fset x | x in e2 & x \in e1]) 2 ^ minn (∇i) l
7b6
79e
7b8
79e
\sum_(i <- [fset x | x in e1 & x \notin e2]) 2 ^ minn (∇i) l = \sum_(i <- e1 `\` e2) f i
by apply: eq_fbigl => i; rewrite !inE andbC. Qed. (* This is 2.6 *)
ef
s:nat
a:nat_choiceType

#|` e `\` `[Δs]| <= s -> a \in e -> ψ(e) - ψ(e `\ a) <= 2 ^ s.-1
7cd
ef7d07d1
CLs:#|` e `\` `[Δs]| <= s
aIe:a \in e

ψ(e) - ψ(e `\ a) <= 2 ^ s.-1
7d7
(ψ(e)%:R - ψ(e `\ a)%:R <= (2 ^ s.-1)%:R)%R
ef7d07d17d87d9f6
Hl:(ψ(e)%:R)%R = ψ'(l) e

7de
ef7d07d17d87d9f67e3
l1:nat

s <= l1.+1 -> (ψ'(l1.+1) e <= ψ'(l1) e)%R
ef7d07d17d87d9f67e3
F:forall l1 : nat, s <= l1.+1 -> (ψ'(l1.+1) e <= ψ'(l1) e)%R
7de
ef7d07d17d87d9f67e37e8
sLl1:s <= l1.+1

(ψ'(l1.+1) e <= ψ'(l1) e)%R
7ea
7f1
(((2 ^ l1.+1 * #|` [fset i | i in e & (l1 < ∇i)%N]|.+1).-1 + \sum_(i <- e | (∇i < l1.+1)%N) 2 ^ ∇i)%:R - (l1.+1 * 2 ^ l1.+1)%:R <= ψ'(l1) e)%R
7ea
7f1
(((2 ^ l1.+1 * #|` [fset i | i in e & (l1 < ∇i)%N]|.+1).-1 + \sum_(i <- e | (∇i < l1.+1)%N) 2 ^ ∇i)%:R - (l1.+1 * 2 ^ l1.+1)%:R <= ((2 ^ l1 * #|` [fset i | i in e & (l1 < ∇i)%N]|.+1).-1 + \sum_(i <- e | (∇i <= l1)%N) 2 ^ ∇i)%:R - (l1 * 2 ^ l1)%:R)%R
7ea
ef7d07d17d87d9f67e37e87f2
s1:=\sum_(H <- e | ∇H < l1.+1) 2 ^ ∇H:nat

(((2 ^ l1.+1 * #|` [fset i | i in e & (l1 < ∇i)%N]|.+1).-1 + s1)%:R - (l1.+1 * 2 ^ l1.+1)%:R <= ((2 ^ l1 * #|` [fset i | i in e & (l1 < ∇i)%N]|.+1).-1 + s1)%:R - (l1 * 2 ^ l1)%:R)%R
7ea
7ff
[fset i | i in e & l1 < ∇i] = [fset i | i in e & Δl1.+1 <= i]
7ff
(((2 ^ l1.+1 * #|` [fset i | i in e & (Δl1.+1 <= i)%N]|.+1).-1 + s1)%:R - (l1.+1 * 2 ^ l1.+1)%:R <= ((2 ^ l1 * #|` [fset i | i in e & (Δl1.+1 <= i)%N]|.+1).-1 + s1)%:R - (l1 * 2 ^ l1)%:R)%R
7eb
7ff
808
7ea
ef7d07d17d87d9f67e37e87f2800
c:=#|` [fset i | i in e & Δl1.+1 <= i]|:nat

(((2 ^ l1.+1 * c.+1).-1 + s1)%:R - (l1.+1 * 2 ^ l1.+1)%:R <= ((2 ^ l1 * c.+1).-1 + s1)%:R - (l1 * 2 ^ l1)%:R)%R
7ea
80f
c <= s
ef7d07d17d87d9f67e37e87f2800810
Hc:c <= s
811
7eb
ef7d07d17d9f67e37e87f2800810

c <= #|` e `\` `[Δs]|
816
81d
[fset i | i in e & Δl1.+1 <= i] `<=` e `\` `[Δs]
816
ef7d07d17d9f67e37e87f280081011f

i \in [fset i | i in e & Δl1.+1 <= i] -> i \in e `\` `[Δs]
816
ef7d07d17d9f67e37e87f280081011f
H:Δl1.+1 <= i

(i \notin `[Δs]) && true
816
82b
Δs <= Δl1.+1
816
818
811
7ea
818
(((2 ^ l1 * (2 * c.+1)).-1 + s1)%:R - (l1.+1 * (2 * 2 ^ l1))%:R <= ((2 ^ l1 * c.+1).-1 + s1)%:R - (l1 * 2 ^ l1)%:R)%R
7ea
818
(((2 ^ l1 * (c.+1 + c.+1)).-1 + s1)%:R - ((l1.+2 + l1) * 2 ^ l1)%:R <= ((2 ^ l1 * c.+1).-1 + s1)%:R - (l1 * 2 ^ l1)%:R)%R
7ea
818
((2 ^ l1 * c.+1 + (2 ^ l1 * c.+1).-1 + s1)%:R - (l1.+2 * 2 ^ l1 + l1 * 2 ^ l1)%:R <= ((2 ^ l1 * c.+1).-1 + s1)%:R - (l1 * 2 ^ l1)%:R)%R
7ea
ef7d07d17d87d9f67e37e87f2800810819
x:=2 ^ l1 * c.+1:nat

((x + x.-1 + s1)%:R - (l1.+2 * 2 ^ l1 + l1 * 2 ^ l1)%:R <= (x.-1 + s1)%:R - (l1 * 2 ^ l1)%:R)%R
7ea
844
((x.-1 + s1 + x)%:R - (l1.+2 * 2 ^ l1 + l1 * 2 ^ l1)%:R <= (x.-1 + s1)%:R - (l1 * 2 ^ l1)%:R)%R
7ea
844
((x.-1 + s1 + x)%:R - (l1.+2 * 2 ^ l1)%:R <= (x.-1 + s1)%:R)%R
7ea
844
x <= l1.+2 * 2 ^ l1
7ea
7ec
7de
ef7d07d17d87d9f67e37ed
l1:=minn l s.-1:nat

7de
859
(ψ(e)%:R)%R = ψ'(l1) e
859
(ψ'(l1) e - ψ(e `\ a)%:R <= (2 ^ s.-1)%:R)%R
ef7d07d17d87d9f67e37ed85a
E:s.-1 < l

85e
85f
ef7d07d17d87d9f67e37ed85a866
U:minn l s.-1 = s.-1

85e
85f
86a
(ψ(e)%:R)%R = ψ'(s.-1) e
85f
86a
(ψ'(l) e <= ψ'(s.-1) e)%R
85f
86a
(ψ'(l - s.-1 + s.-1) e <= ψ'(s.-1) e)%R
85f
ef7d07d17d87d9f67e37ed85a86686b482
IH:(ψ'(k + s.-1) e <= ψ'(s.-1) e)%R

(ψ'(k.+1 + s.-1) e <= ψ'(s.-1) e)%R
85f
ef7d07d17d87d9f67e37ed85a86686b482

(ψ'(k.+1 + s.-1) e <= ψ'(k + s.-1) e)%R
85f
881
(ψ'((k + s.-1).+1) e <= ψ'(k + s.-1) e)%R
85f
ef7d07d17d87d9f67e385a86686b482

s <= (k + s.-1).+1
85f
ef7d07d17d87d9f67e385a86686b
k, s1:nat

s1 < (k + s1.+1.-1).+1
85f
859
861
859
(ψ'(l1) e - ψ'(l1) (e `\ a) <= (2 ^ s.-1)%:R)%R
859
((\sum_(i <- e) 2 ^ minn (∇i) l1)%:R - (\sum_(i <- e `\ a) 2 ^ minn (∇i) l1)%:R <= (2 ^ s.-1)%:R)%R
859
\sum_(i <- e) 2 ^ minn (∇i) l1 - \sum_(i <- e `\ a) 2 ^ minn (∇i) l1 <= 2 ^ s.-1
859
minn (∇a) l1 <= s.-1
by apply: leq_trans (geq_minr _ _) (geq_minr _ _). Qed. (* This is 2.7 *)
n, s:nat
f7

e1 `<=` `[n] -> Δs.-1 <= n -> #|` e2| <= s -> ψ(e1 `|` e2) - ψ(e1) <= ψ(`[n + s]) - ψ(`[n])
8a6
8a9f7
e1Sn:e1 `<=` `[n]

Δs.-1 <= n -> #|` e2| <= s -> ψ(e1 `|` e2) - ψ(e1) <= ψ(`[n + s]) - ψ(`[n])
1e
e1:{fset nat}
8b0
e2:{fset nat}

#|` e2| <= 0 -> ψ(e1 `|` e2) - ψ(e1) <= ψ(`[n + 0]) - ψ(`[n])
1e8b68b07d0
IH:forall e2, Δs.-1 <= n -> #|` e2| <= s -> ψ(e1 `|` e2) - ψ(e1) <= ψ(`[n + s]) - ψ(`[n])
8b7
dLn:Δs.+1.-1 <= n
Ce2:#|` e2| <= s.+1
ψ(e1 `|` e2) - ψ(e1) <= ψ(`[n + s.+1]) - ψ(`[n])
8b5
ψ(e1 `|` fset0) - ψ(e1) <= ψ(`[n + 0]) - ψ(`[n])
8b9
8bb
8bf
8bb
ψ(e1 `|` fset0) - ψ(e1) <= ψ(`[n + s.+1]) - ψ(`[n])
1e8b68b07d08bc8b78bd8be327
xIe2:x \in e2
8bf
8cd
8bf
8cd
Δs.-1 <= n
1e8b68b07d08bc8b78bd8be3278ce
dLn1:Δs.-1 <= n
8bf
1e8b68b07d08bc8b78be3278ce

Δs.-1 <= Δs.+1.-1
8d6
8d8
8bf
1e8b68b07d08bc8b78bd8be3278ce8d9
e3:=e2 `\ x:{fset nat_choiceType}

8bf
8e5
#|` e3| <= s
1e8b68b07d08bc8b78bd8be3278ce8d98e6
Ce3:#|` e3| <= s
8bf
8ed
8bf
8ed
ψ(e1 `|` e2) - ψ(e1 `|` e3) + (ψ(e1 `|` e3) - ψ(e1)) <= ψ(`[n + s.+1]) - ψ(`[n])
8ed
ψ(e1 `|` e2) - ψ(e1 `|` e3) + (ψ(e1 `|` e3) - ψ(e1)) <= ψ(`[n + s]) + 2 ^ (∇(n + s).+1).-1 - ψ(`[n])
8ed
ψ(`[n]) <= ψ(`[n + s])
8ed
ψ(e1 `|` e2) - ψ(e1 `|` e3) + (ψ(e1 `|` e3) - ψ(e1)) <= 2 ^ (∇(n + s).+1).-1 + (ψ(`[n + s]) - ψ(`[n]))
8ed
900
8ed
ψ(e1 `|` e2) - ψ(e1 `|` e3) <= 2 ^ (∇(n + s).+1).-1
1e8b68b07d08bc8b78bd8be3278ce8d98e68ee
xIe1:x \in e1

907
1e8b68b07d08bc8b78bd8be3278ce8d98e68ee
xNIe1:x \notin e1
907
90b
e1 `|` e2 = e1 `|` e3
90b
ψ(e1 `|` e3) - ψ(e1 `|` e3) <= 2 ^ (∇(n + s).+1).-1
90e
1e8b68b07d08bc8b78bd8be3278ce8d98e68ee90c11f

(i \in e1) || (i \in e2) = (i \in e1) || (i != x) && (i \in e2)
915
90b
917
90d
90f
907
90f
e1 `|` e3 = (e1 `|` e2) `\ x
90f
ψ(e1 `|` e2) - ψ((e1 `|` e2) `\ x) <= 2 ^ (∇(n + s).+1).-1
1e8b68b07d08bc8b78bd8be3278ce8d98e68ee91011f

(i \in e1) || (i != x) && (i \in e2) = (i != x) && ((i \in e1) || (i \in e2))
927
92d
(x \in e1) || ~~ true && (x \in e2) = ~~ true && ((x \in e1) || (x \in e2))
927
90f
929
90f
x \in e1 `|` e2
90f
#|` (e1 `|` e2) `\` `[Δ(∇(n + s).+1)]| <= ∇(n + s).+1
90f
93c
90f
#|` (e1 `|` e2) `\` `[Δ(∇(n + s.+1))]| <= ∇(n + s.+1)
1e8b68b07d08bc8b78bd8be3278ce8d98e68ee910
t:=s.+1:nat

#|` (e1 `|` e2) `\` `[Δ(∇(n + t))]| <= ∇(n + t)
1e8b68b07d08bc8b78bd8be3278ce8d98e68ee910948
g:=∇(n + t):nat

#|` (e1 `|` e2) `\` `[Δg]| <= g
94d
#|` (e1 `|` e2) `\` `[Δg]| <= #|` e2 `|` e1 `\` `[Δg]|
94d
#|` e2 `|` e1 `\` `[Δg]| <= g
94d
(e1 `|` e2) `\` `[Δg] `<=` e2 `|` e1 `\` `[Δg]
954
1e8b68b07d08bc8b78bd8be3278ce8d98e68ee91094894e11f

i \in (e1 `|` e2) `\` `[Δg] -> i \in e2 `|` e1 `\` `[Δg]
954
95e
(i \notin `[Δg]) && ((i \in e1) || (i \in e2)) -> (i \in e2) || (i \notin `[Δg]) && (i \in e1)
954
94d
956
94d
#|` e2 `|` e1 `\` `[Δg]| <= #|` e2| + #|` e1 `\` `[Δg]|
94d
#|` e2| + #|` e1 `\` `[Δg]| <= g
94d
96d
94d
#|` e2| + #|` e1 `\` `[Δg]| <= t + #|` e1 `\` `[Δg]|
94d
t + #|` e1 `\` `[Δg]| <= g
94d
977
94d
t + #|` e1 `\` `[Δg]| <= t + #|` sint (Δg) n|
94d
t + #|` sint (Δg) n| <= g
94d
#|` e1 `\` `[Δg]| <= #|` sint (Δg) n|
97f
94d
e1 `\` `[Δg] `<=` sint (Δg) n
97f
95e
i \in e1 `\` `[Δg] -> i \in sint (Δg) n
97f
95e
i \in `[n] -> true && (i < n)
97f
94d
981
94d
t + (n - Δg) <= g
1e8b68b07d08bc8b78bd8be3278ce8d98e68ee91094894e
E:Δg < n

998
94d
n <= Δg -> t + (n - Δg) <= g
99c
t + n - Δg <= g
99e
99c
n + t <= Δg + g
99e
94d
9a0
94d
t <= g
by rewrite root_delta_le deltaS leq_add2r. Qed. (* This is 2.8 *)
28f
ϕ(#|` e1 `|` e2|.+3) <= ((ψ(e1) + ψ(e2)).*2).*2 + 5
9b1
28f
(ϕ(#|` e1 `|` e2|.+3)%:R <= ((ψ(e1) + ψ(e2)).*2).*2%:R + 5%:R)%R
28f
(ϕ(#|` e1 `|` e2|.+3)%:R <= (ψ(e1)%:R + ψ(e2)%:R) *+ (2 * 2) + 5%:R)%R
f7
n:=#|` e1 `|` e2|:nat

(ϕ(n.+3)%:R <= (ψ(e1)%:R + ψ(e2)%:R) *+ (2 * 2) + 5%:R)%R
f79c1
m:=∇n.+3:nat

9c2
f79c19c7
p:=tmod n.+3:nat

9c2
f79c19c79cc
l:=m.-2:nat

9c2
f79c19c79cc9d1
mG2:1 < m

9c2
9d5
p <= m
f79c19c79cc9d19d6
pLm:p <= m
9c2
9dd
9c2
9dd
Δl <= n
f79c19c79cc9d19d69de
nG:Δl <= n
9c2
9dd
Δm.-2 <= (Δm + tmod n.+3).-1.-2
9e6
f79c19c79cc9d19de
m1:nat

Δm1.+2.-2 <= (Δm1.+2 + tmod n.+3).-1.-2
9e6
9e8
9c2
9e8
((ψ'(l) `[0] + ψ'(l) `[n]) *+ 4 + 5%:R <= (ψ(e1)%:R + ψ(e2)%:R) *+ (2 * 2) + 5%:R)%R
9e8
(ϕ(n.+3)%:R <= (ψ'(l) `[0] + ψ'(l) `[n]) *+ 4 + 5%:R)%R
9e8
(ψ'(l) `[0] + ψ'(l) `[n] <= ψ(e1)%:R + ψ(e2)%:R)%R
9fb
9e8
(ψ'(l) e1 + ψ'(l) e2 <= ψ(e1)%:R + ψ(e2)%:R)%R
9e8
(ψ'(l) `[0] + ψ'(l) `[n] <= ψ'(l) e1 + ψ'(l) e2)%R
9fc
9e8
a08
9fb
9e8
(ψ'(l) `[0] + ψ'(l) `[n] <= ψ'(l) (e1 `&` e2) + ψ'(l) (e1 `|` e2))%R
9e8
(ψ'(l) (e1 `&` e2) + ψ'(l) (e1 `|` e2) <= ψ'(l) e1 + ψ'(l) e2)%R
9fc
9e8
(ψ'(l) `[0] <= ψ'(l) (e1 `&` e2))%R
a10
9e8
fset0 `<=` e1 `&` e2
a10
9e8
a12
9fb
9e8
(((2 ^ l).-1 + \sum_(i <- e1 `&` e2) 2 ^ minn (∇i) l)%:R - (l * 2 ^ l)%:R + (((2 ^ l).-1 + \sum_(i <- (e1 `|` e2)) 2 ^ minn (∇i) l)%:R - (l * 2 ^ l)%:R) <= ((2 ^ l).-1 + \sum_(i <- e1) 2 ^ minn (∇i) l)%:R - (l * 2 ^ l)%:R + (((2 ^ l).-1 + \sum_(i <- e2) 2 ^ minn (∇i) l)%:R - (l * 2 ^ l)%:R))%R
9fb
9e8
((\sum_(i <- e1 `&` e2) 2 ^ minn (∇i) l)%:R + (1 *- (l * 2 ^ l) + ((2 ^ l).-1%:R + (\sum_(i <- (e1 `|` e2)) 2 ^ minn (∇i) l)%:R)) <= (\sum_(i <- e1) 2 ^ minn (∇i) l)%:R + (1 *- (l * 2 ^ l) + ((2 ^ l).-1%:R + (\sum_(i <- e2) 2 ^ minn (∇i) l)%:R)))%R
9fb
9e8
((\sum_(i <- e1 `&` e2) 2 ^ minn (∇i) l)%:R + ((2 ^ l).-1%:R + (\sum_(i <- (e1 `|` e2)) 2 ^ minn (∇i) l)%:R) <= (\sum_(i <- e1) 2 ^ minn (∇i) l)%:R + ((2 ^ l).-1%:R + (\sum_(i <- e2) 2 ^ minn (∇i) l)%:R))%R
9fb
9e8
((\sum_(i <- e1 `&` e2) 2 ^ minn (∇i) l)%:R + (\sum_(i <- (e1 `|` e2)) 2 ^ minn (∇i) l)%:R <= (\sum_(i <- e1) 2 ^ minn (∇i) l)%:R + (\sum_(i <- e2) 2 ^ minn (∇i) l)%:R)%R
9fb
9e8
\sum_(i <- e1 `&` e2) 2 ^ minn (∇i) l + \sum_(i <- (e1 `|` e2)) 2 ^ minn (∇i) l <= \sum_(i <- e1) 2 ^ minn (∇i) l + \sum_(i <- e2) 2 ^ minn (∇i) l
9fb
9e8
\sum_(i <- e1 `&` e2) 2 ^ minn (∇i) l + \sum_(i <- (e1 `|` e2)) 2 ^ minn (∇i) l <= \sum_(i <- e1 | i \in e2) 2 ^ minn (∇i) l + \sum_(i <- e1 | i \notin e2) 2 ^ minn (∇i) l + \sum_(i <- e2) 2 ^ minn (∇i) l
9fb
9e8
\sum_(i <- e1 `&` e2) 2 ^ minn (∇i) l <= \sum_(i <- e1 | i \in e2) 2 ^ minn (∇i) l
9e8
\sum_(i <- (e1 `|` e2)) 2 ^ minn (∇i) l <= \sum_(i <- e1 | i \notin e2) 2 ^ minn (∇i) l + \sum_(i <- e2) 2 ^ minn (∇i) l
9fc
9e8
\sum_(i <- e1 `&` e2) 2 ^ minn (∇i) l = \sum_(i <- e1 | i \in e2) 2 ^ minn (∇i) l
a3a
9e8
a3c
9fb
9e8
\sum_(i <- (e1 `|` e2) | i \in e2) 2 ^ minn (∇i) l + \sum_(i <- (e1 `|` e2) | i \notin e2) 2 ^ minn (∇i) l <= \sum_(i <- e1 | i \notin e2) 2 ^ minn (∇i) l + \sum_(i <- e2) 2 ^ minn (∇i) l
9fb
9e8
\sum_(i <- (e1 `|` e2) | i \notin e2) 2 ^ minn (∇i) l <= \sum_(i <- e1 | i \notin e2) 2 ^ minn (∇i) l
9e8
\sum_(i <- (e1 `|` e2) | i \in e2) 2 ^ minn (∇i) l <= \sum_(i <- e2) 2 ^ minn (∇i) l
9fc
9e8
\sum_(i <- (e1 `|` e2) | i \notin e2) 2 ^ minn (∇i) l = \sum_(i <- e1 | i \notin e2) 2 ^ minn (∇i) l
a4c
f79c19c79cc9d19d69de9e911f

((i \in e1) || (i \in e2)) && (i \notin e2) = (i \in [eta mem_seq e1]) && (i \notin e2)
a4c
9e8
a4e
9fb
9e8
\sum_(i <- (e1 `|` e2) | i \in e2) 2 ^ minn (∇i) l = \sum_(i <- e2) 2 ^ minn (∇i) l
9fb
a56
((i \in e1) || (i \in e2)) && (i \in e2) = (i \in [eta mem_seq e2]) && true
9fb
9e8
9fd
9e8
ϕ(n.+3) = ((m + p - 1) * 2 ^ m).+1
f79c19c79cc9d19d69de9e9
pE:ϕ(n.+3) = ((m + p - 1) * 2 ^ m).+1
9fd
9e8
1 + (m.-1.+1 + p) * 2 ^ m - 2 ^ m = ((m.-1.+1 + p - 1) * 2 ^ m).+1
a6a
9e8
(1 + (m.-1 + p) * 2 ^ m)%N = (((m.-1 + p).+1 - 1) * 2 ^ m).+1
a6a
a6c
9fd
a6c
(ϕ(Δl)%:R)%R = (1 + (l%:R - 1) * (2 ^ l)%:R)%R
f79c19c79cc9d19d69de9e9a6d
pdE:(ϕ(Δl)%:R)%R = (1 + (l%:R - 1) * (2 ^ l)%:R)%R
9fd
a6c
2 ^ l <= 1 + l * 2 ^ l
a6c
((1 + l * 2 ^ l)%:R - (2 ^ l)%:R)%R = (1 + (l%:R - 1) * (2 ^ l)%:R)%R
a7e
a6c
a87
a7d
a7f
9fd
a7f
(ϕ(n.+3)%:R)%R = ((ψ'(l) `[0] + ψ'(l) `[n]) *+ 4 + 5%:R)%R
(* right part *)
a7f
(ϕ(n.+3)%:R)%R = ((((2 ^ l).-1 + \sum_(0 <= i < 0) 2 ^ minn (∇i) l)%:R - (l * 2 ^ l)%:R + (((2 ^ l * #|` [fset i | i in `[n] & (l <= ∇i)%N]|.+1).-1 + \sum_(i <- `[n] | (∇i < l)%N) 2 ^ ∇i)%:R - (l * 2 ^ l)%:R)) *+ 4 + 5%:R)%R
f79c19c79cc9d19d69de9e9a6da8079f

a95
a99
(ϕ(n.+3)%:R)%R = (((2 ^ l).-1%:R - (l * 2 ^ l)%:R + (((2 ^ l * #|` [fset i | i in `[n] & (l <= ∇i)%N]|.+1).-1 + \sum_(i <- `[n] | (∇i < l)%N) 2 ^ ∇i)%:R - (l * 2 ^ l)%:R)) *+ 4 + 5%:R)%R
a99
[fset i | i in `[n] & l <= ∇i] = [fset i | i in `[n] & Δl <= i]
a99
(ϕ(n.+3)%:R)%R = (((2 ^ l).-1%:R - (l * 2 ^ l)%:R + (((2 ^ l * #|` [fset i | i in `[n] & (Δl <= i)%N]|.+1).-1 + \sum_(i <- `[n] | (∇i < l)%N) 2 ^ ∇i)%:R - (l * 2 ^ l)%:R)) *+ 4 + 5%:R)%R
a99
aa4
a99
0 <= Δl
a99
(ϕ(n.+3)%:R)%R = (((2 ^ l).-1%:R - (l * 2 ^ l)%:R + (((2 ^ l * #|` sint (Δl) n|.+1).-1 + \sum_(i <- `[n] | (∇i < l)%N) 2 ^ ∇i)%:R - (l * 2 ^ l)%:R)) *+ 4 + 5%:R)%R
a99
aae
a99
(ϕ(n.+3)%:R)%R = (((2 ^ l).-1%:R - (l * 2 ^ l)%:R + (((2 ^ l * (n - Δl).+1).-1 + \sum_(i <- `[n] | (∇i < l)%N) 2 ^ ∇i)%:R - (l * 2 ^ l)%:R)) *+ 4 + 5%:R)%R
a99
\sum_(H <- `[n] | ∇H < l) 2 ^ ∇H = ϕ(Δl)
a99
(ϕ(n.+3)%:R)%R = (((2 ^ l).-1%:R - (l * 2 ^ l)%:R + (((2 ^ l * (n - Δl).+1).-1 + ϕ(Δl))%:R - (l * 2 ^ l)%:R)) *+ 4 + 5%:R)%R
a99
\sum_(H <- `[n] | ∇H < l) 2 ^ ∇H = \sum_(i < Δl) 2 ^ ∇i
aba
a99
(fun i : nat => ∇i < l) =1 (fun i : nat => (i < n) && (∇i < l))
a99
\sum_(i <- `[n] | (i < n) && (∇i < l)) 2 ^ ∇i = \sum_(i < Δl) 2 ^ ∇i
abb
f79c19c79cc9d19d69de9e9a6da8079f150

i < Δl -> true = (i < n)
ac5
a99
ac7
aba
a99
xpredT =1 (fun i : 'I_(Δl) => i \in `[n])
a99
\sum_(i <- `[n] | (i < n) && (∇i < l)) 2 ^ ∇i = \sum_(i < Δl | i \in `[n]) 2 ^ ∇i
abb
a99
ad6
aba
a99
\sum_(i <- [::] | (i < n) && (∇i < l)) 2 ^ ∇i = \sum_(i < Δl | i \in [::]) 2 ^ ∇i
f79c19c79cc9d19d69de9e9a6da8079fa
l1:seq nat
IH:uniq l1 -> \sum_(i <- l1 | (i < n) && (∇i < l)) 2 ^ ∇i = \sum_(i < Δl | i \in l1) 2 ^ ∇i
aNIl:a \notin l1
lU:uniq l1
\sum_(i <- (a :: l1) | (i < n) && (∇i < l)) 2 ^ ∇i = \sum_(i < Δl | i \in a :: l1) 2 ^ ∇i
abb
ae0
ae5
aba
f79c19c79cc9d19d69de9e9a6da8079faae1ae2ae3ae465f

\sum_(i < Δl | i \in l1) 2 ^ ∇i = \sum_(i < Δl | i \in a :: l1) 2 ^ ∇i
f79c19c79cc9d19d69de9e9a6da8079faae1ae2ae3ae4664
(if ∇a < l then (2 ^ ∇a + \sum_(i < Δl | i \in l1) 2 ^ ∇i)%N else \sum_(i < Δl | i \in l1) 2 ^ ∇i) = \sum_(i < Δl | i \in a :: l1) 2 ^ ∇i
abb
f79c19c79cc9d19d69de9e9a6da8079faae1ae2ae3ae465f
i:'I_(Δl)

a < Δl -> (a \in l1) = true || (a \in l1)
aee
af0
af1
aba
f79c19c79cc9d19d69de9e9a6da8079faae1ae2ae3ae4664
aLl:l <= ∇a

aed
f79c19c79cc9d19d69de9e9a6da8079faae1ae2ae3ae4664
aLl:∇a < l
(2 ^ ∇a + \sum_(i < Δl | i \in l1) 2 ^ ∇i)%N = \sum_(i < Δl | i \in a :: l1) 2 ^ ∇i
abb
f79c19c79cc9d19d69de9e9a6da8079faae1ae2ae3ae4664affaf6

af7
b00
b02
b04
aba
f79c19c79cc9d19d69de9e9a6da8079faae1ae2ae3ae4664
aLl:a < Δl

b04
aba
b0f
(2 ^ ∇a + \sum_(i < Δl | i \in l1) 2 ^ ∇i)%N == addn_comoid (2 ^ ∇(Ordinal aLl)) (\big[addn_comoid/0]_(i | (i \in a :: l1) && (i != Ordinal aLl)) 2 ^ ∇i)
aba
b0f
\sum_(i < Δl | i \in l1) 2 ^ ∇i = \sum_(i < Δl | (i \in a :: l1) && (i != Ordinal aLl)) 2 ^ ∇i
aba
f79c19c79cc9d19d69de9e9a6da8079faae1ae2ae3ae4664b10af6

(i \in l1) = ((i == a) || (i \in l1)) && (i != a)
aba
a99
abc
(* right part *)
a99
(((2 ^ l)%:R * (m.-1 + p)%:R - 1%:R) *+ 4 + 5%:R)%R = (((2 ^ l).-1%:R - (l * 2 ^ l)%:R + (((2 ^ l * (n - Δl).+1).-1 + ϕ(Δl))%:R - (l * 2 ^ l)%:R)) *+ 4 + 5%:R)%R
a99
(ϕ(n.+3)%:R)%R = (((2 ^ l)%:R * (m.-1 + p)%:R - 1%:R) *+ 4 + 5%:R)%R
a99
((2 ^ l)%:R * (m.-1 + p)%:R - 1%:R)%R = ((2 ^ l).-1%:R - (l * 2 ^ l)%:R + (((2 ^ l * (n - Δl).+1).-1 + ϕ(Δl))%:R - (l * 2 ^ l)%:R))%R
b25
a99
((2 ^ l)%:R * (m - 1 + p)%:R - 1%:R)%R = ((2 ^ l)%:R - 1%:R - l%:R * (2 ^ l)%:R + ((2 ^ l)%:R * (n - Δl).+1%:R - 1%:R + ϕ(Δl)%:R - l%:R * (2 ^ l)%:R))%R
b25
f79c19c79cc9d19d69de9e9a6da8079f
u:=((2 ^ l)%:R)%R:Num.NumDomain.porder_ringType int_numDomainType

(u * (m - 1 + p)%:R - 1%:R)%R = (u - 1%:R - l%:R * u + u * (n - Δl).+1%:R + (l%:R - 1) * u - l%:R * u)%R
b25
b33
(u * (m - 1 + p)%:R)%R = (u + (- (l%:R * u) + (u * (n - Δl).+1%:R + ((l%:R - 1) * u - l%:R * u))))%R
b25
b33
((m - 1 + p)%:R * u)%R = ((1 + (1 *- l + ((n - Δl).+1%:R + (l%:R - 1 - l%:R)))) * u)%R
b25
b33
((m - 1 + p)%:R)%R = (1 + (1 *- l + ((n - Δl).+1%:R + (l%:R - 1 - l%:R))))%R
b25
a99
((m - 1 + p)%:R)%R = (1 - l%:R + (n - Δl).+1%:R - 1)%R
b25
a99
((m - 1 + p)%:R)%R = (1 - l%:R + (n - Δl)%:R)%R
b25
a99
((m - 1 + p)%:R)%R = (1 - l%:R + ((Δm + p).-1.-2 - Δl)%:R)%R
b25
a99
((m.-1 + p)%:R)%R = (1 - l%:R + ((Δm.-2 + m.-2.+1 + m.-2.+2 + p).-1.-2 - Δl)%:R)%R
b25
a99
((m.-1 + p)%:R)%R = (1 - l%:R + (l + (l + p))%:R)%R
b25
a99
b27
(* left part *)
a99
(((m + p - 1) * 2 ^ m).+1%:R)%R = (((2 ^ m.-2)%:R * (m.-1 + p)%:R - 1%:R) *+ 4 + 5%:R)%R
f79c19c79cc9d19de9e9a6da8079f9f2

(((m1.+2 + p - 1) * 2 ^ m1.+2).+1%:R)%R = (((2 ^ m1)%:R * (m1.+1 + p)%:R - 1%:R) *+ 4 + 5%:R)%R
b60
(((m1.+1 + p) * 2 ^ m1.+2).+1%:R)%R = (((2 ^ m1)%:R * (m1.+1 + p)%:R - 1%:R) *+ 4 + 5%:R)%R
b60
(((m1.+1 + p) * 2 ^ m1.+2).+1%:R)%R = (((2 ^ m1)%:R * (m1.+1 + p)%:R - 1%:R + 1) *+ 4 + 1)%R
b60
(((m1.+1 + p) * 2 ^ m1.+2)%:R)%R = ((2 ^ m1)%:R * (m1.+1 + p)%:R *+ 4)%R
b60
((2 ^ m1.+2 * (m1.+1 + p))%:R)%R = ((2 ^ m1 * 4 * (m1.+1 + p))%:R)%R
b60
2 ^ m1.+2 = 2 ^ m1 * 4
by rewrite mulnC !expnS !mulnA. Qed.
2dc
ϕ(n.+3) = ψ(`[n.+2]).*2.+1
b77
by rewrite psi_sint_phi prednK ?phi_gt0. Qed.
2dc
ϕ(n.+3) = (\sum_(1 <= i < n.+3) 2 ^ ∇i).+1
b7c
2dc
\sum_(i < n.+3) 2 ^ ∇i = (\sum_(1 <= i < n.+3) 2 ^ ∇i).+1
2dc
\sum_(0 <= i < n.+3) 2 ^ ∇i = (\sum_(1 <= i < n.+3) 2 ^ ∇i).+1
2dc
(\sum_(0 <= i < 1) 2 ^ ∇i + \sum_(1 <= i < n.+3) 2 ^ ∇i)%N = (\sum_(1 <= i < n.+3) 2 ^ ∇i).+1
by rewrite big_nat_recl //= big_mkord big_ord0 addn0 add1n. Qed. End PsiDef.
1e
i:'I_n.+2

i != ord_max -> i < n.+1
b8d
b8f
val i != val ord_max -> i < n.+1
by have := ltn_ord i; rewrite ltnS leq_eqVlt => /orP[->|]. Qed.
b8f
i != ord_max -> lift ord_max (inord i) = i
b98
1eb90
iDm:i != ord_max

lift ord_max (inord i) = i
b9f
i < n.+1
by apply: ltn_diff_ord_max. Qed.
1e
e:{set 'I_n.+2}

e :\ ord_max = [set lift ord_max x | x : ordinal_finType n.+2.-1 & lift ord_max x \in e]
ba7
1ebaa
i:ordinal_finType n.+2

(i != ord_max) && (i \in e) = (i \in [set lift ord_max x | x : 'I_n.+1 & lift ord_max x \in e])
1ebaabb1
iH:i != ord_max
a9

exists2 x : ordinal_finType n.+1, x \in [set i | lift ord_max i \in e] & i = lift ord_max x
1ebaabb1
j:ordinal_finType n.+1
j \in [set i | lift ord_max i \in e] -> i = lift ord_max j -> i != ord_max /\ i \in e
bb6
inord i \in [set i | lift ord_max i \in e]
bb6
i = lift ord_max (inord i)
bba
bb6
bc4
bb9
bbb
bbd
1ebaabb1bbc
kH:lift ord_max j \in e

lift ord_max j != ord_max
bce
val (lift ord_max j) != val ord_max
by rewrite [val (lift _ _)]lift_max /= neq_ltn ltn_ord. Qed.