Step | Hyp | Ref | Expression |
1 |
|
bitr4 |
(n < len l <-> suc n < suc (len l)) -> (suc n < len (a : l) <-> suc n < suc (len l)) -> (n < len l <-> suc n < len (a : l)) |
2 |
|
ltsuc |
n < len l <-> suc n < suc (len l) |
3 |
1, 2 |
ax_mp |
(suc n < len (a : l) <-> suc n < suc (len l)) -> (n < len l <-> suc n < len (a : l)) |
4 |
|
lteq2 |
len (a : l) = suc (len l) -> (suc n < len (a : l) <-> suc n < suc (len l)) |
5 |
|
lenS |
len (a : l) = suc (len l) |
6 |
4, 5 |
ax_mp |
suc n < len (a : l) <-> suc n < suc (len l) |
7 |
3, 6 |
ax_mp |
n < len l <-> suc n < len (a : l) |
8 |
|
ifpos |
suc n < len (a : l) -> if (suc n < len (a : l)) (suc (listfn (a : l) @ suc n)) 0 = suc (listfn (a : l) @ suc n) |
9 |
8 |
conv nth |
suc n < len (a : l) -> nth (suc n) (a : l) = suc (listfn (a : l) @ suc n) |
10 |
7, 9 |
sylbi |
n < len l -> nth (suc n) (a : l) = suc (listfn (a : l) @ suc n) |
11 |
|
suceq |
listfn (a : l) @ suc n = listfn l @ n -> suc (listfn (a : l) @ suc n) = suc (listfn l @ n) |
12 |
|
listfnSS |
listfn (a : l) @ suc n = listfn l @ n |
13 |
11, 12 |
ax_mp |
suc (listfn (a : l) @ suc n) = suc (listfn l @ n) |
14 |
|
ifpos |
n < len l -> if (n < len l) (suc (listfn l @ n)) 0 = suc (listfn l @ n) |
15 |
14 |
conv nth |
n < len l -> nth n l = suc (listfn l @ n) |
16 |
13, 15 |
syl6eqr |
n < len l -> nth n l = suc (listfn (a : l) @ suc n) |
17 |
10, 16 |
eqtr4d |
n < len l -> nth (suc n) (a : l) = nth n l |
18 |
|
noteq |
(n < len l <-> suc n < len (a : l)) -> (~n < len l <-> ~suc n < len (a : l)) |
19 |
18, 7 |
ax_mp |
~n < len l <-> ~suc n < len (a : l) |
20 |
|
ifneg |
~suc n < len (a : l) -> if (suc n < len (a : l)) (suc (listfn (a : l) @ suc n)) 0 = 0 |
21 |
20 |
conv nth |
~suc n < len (a : l) -> nth (suc n) (a : l) = 0 |
22 |
19, 21 |
sylbi |
~n < len l -> nth (suc n) (a : l) = 0 |
23 |
|
ifneg |
~n < len l -> if (n < len l) (suc (listfn l @ n)) 0 = 0 |
24 |
23 |
conv nth |
~n < len l -> nth n l = 0 |
25 |
22, 24 |
eqtr4d |
~n < len l -> nth (suc n) (a : l) = nth n l |
26 |
17, 25 |
cases |
nth (suc n) (a : l) = nth n l |