Step
*
2
1
1
1
1
of Lemma
list-max-aux-property
1. [T] : Type
2. f : T ⟶ ℤ
3. n : ℕ
4. L : T List
5. ∀L1:T List
     (||L1|| < ||L||
     
⇒ (↑isl(list-max-aux(x.f[x];L1)))
        ∧ let n,x = outl(list-max-aux(x.f[x];L1)) 
          in (x ∈ L1) ∧ (f[x] = n ∈ ℤ) ∧ (∀y∈L1.f[y] ≤ n) 
        supposing 0 < ||L1||)
6. 0 < ||L||
7. L ~ firstn(||L|| - 1;L) @ [last(L)]
8. ¬↑null(L)
9. 1 < ||L||
10. i : ℤ
11. x1 : {x:T| f[x] = i ∈ ℤ} 
12. list-max-aux(x.f[x];firstn(||L|| - 1;L)) = (inl <i, x1>) ∈ (i:ℤ × {x:T| f[x] = i ∈ ℤ}  + Top)
13. i < f[last(L)]
14. True
15. (x1 ∈ firstn(||L|| - 1;L))
16. f[x1] = i ∈ ℤ
17. (∀y∈firstn(||L|| - 1;L).f[y] ≤ i)
18. (last(L) ∈ firstn(||L|| - 1;L) @ [last(L)])
19. f[last(L)] = f[last(L)] ∈ ℤ
20. i1 : ℕ||firstn(||L|| - 1;L)||
⊢ f[firstn(||L|| - 1;L)[i1]] ≤ f[last(L)]
BY
{ (With ⌜i1⌝ (D 17)⋅ THEN Auto) }
Latex:
Latex:
1.  [T]  :  Type
2.  f  :  T  {}\mrightarrow{}  \mBbbZ{}
3.  n  :  \mBbbN{}
4.  L  :  T  List
5.  \mforall{}L1:T  List
          (||L1||  <  ||L||
          {}\mRightarrow{}  (\muparrow{}isl(list-max-aux(x.f[x];L1)))
                \mwedge{}  let  n,x  =  outl(list-max-aux(x.f[x];L1)) 
                    in  (x  \mmember{}  L1)  \mwedge{}  (f[x]  =  n)  \mwedge{}  (\mforall{}y\mmember{}L1.f[y]  \mleq{}  n) 
                supposing  0  <  ||L1||)
6.  0  <  ||L||
7.  L  \msim{}  firstn(||L||  -  1;L)  @  [last(L)]
8.  \mneg{}\muparrow{}null(L)
9.  1  <  ||L||
10.  i  :  \mBbbZ{}
11.  x1  :  \{x:T|  f[x]  =  i\} 
12.  list-max-aux(x.f[x];firstn(||L||  -  1;L))  =  (inl  <i,  x1>)
13.  i  <  f[last(L)]
14.  True
15.  (x1  \mmember{}  firstn(||L||  -  1;L))
16.  f[x1]  =  i
17.  (\mforall{}y\mmember{}firstn(||L||  -  1;L).f[y]  \mleq{}  i)
18.  (last(L)  \mmember{}  firstn(||L||  -  1;L)  @  [last(L)])
19.  f[last(L)]  =  f[last(L)]
20.  i1  :  \mBbbN{}||firstn(||L||  -  1;L)||
\mvdash{}  f[firstn(||L||  -  1;L)[i1]]  \mleq{}  f[last(L)]
By
Latex:
(With  \mkleeneopen{}i1\mkleeneclose{}  (D  17)\mcdot{}  THEN  Auto)
Home
Index