Nuprl Lemma : lastn-as-accum
∀[A:Type]. ∀[n:ℤ]. ∀[L:A List].
  (lastn(n;L) ~ accumulate (with value b and list item x):
                 if ||b|| <z n then b @ [x] else tl(b @ [x]) fi 
                over list:
                  L
                with starting value:
                 []))
Proof
Definitions occuring in Statement : 
lastn: lastn(n;L)
, 
length: ||as||
, 
append: as @ bs
, 
tl: tl(l)
, 
list_accum: list_accum, 
cons: [a / b]
, 
nil: []
, 
list: T List
, 
ifthenelse: if b then t else f fi 
, 
lt_int: i <z j
, 
uall: ∀[x:A]. B[x]
, 
int: ℤ
, 
universe: Type
, 
sqequal: s ~ t
Definitions unfolded in proof : 
uall: ∀[x:A]. B[x]
, 
member: t ∈ T
, 
all: ∀x:A. B[x]
, 
decidable: Dec(P)
, 
or: P ∨ Q
, 
subtype_rel: A ⊆r B
, 
uimplies: b supposing a
, 
top: Top
, 
nat: ℕ
, 
implies: P 
⇒ Q
, 
false: False
, 
ge: i ≥ j 
, 
satisfiable_int_formula: satisfiable_int_formula(fmla)
, 
exists: ∃x:A. B[x]
, 
not: ¬A
, 
and: P ∧ Q
, 
prop: ℙ
, 
guard: {T}
, 
so_lambda: λ2x y.t[x; y]
, 
so_apply: x[s1;s2]
, 
cons: [a / b]
, 
colength: colength(L)
, 
nil: []
, 
it: ⋅
, 
so_lambda: λ2x.t[x]
, 
so_apply: x[s]
, 
sq_type: SQType(T)
, 
less_than: a < b
, 
squash: ↓T
, 
less_than': less_than'(a;b)
, 
append: as @ bs
, 
so_lambda: so_lambda(x,y,z.t[x; y; z])
, 
so_apply: x[s1;s2;s3]
, 
bool: 𝔹
, 
unit: Unit
, 
btrue: tt
, 
uiff: uiff(P;Q)
, 
ifthenelse: if b then t else f fi 
, 
bfalse: ff
, 
true: True
, 
iff: P 
⇐⇒ Q
, 
rev_implies: P 
⇐ Q
, 
bnot: ¬bb
, 
assert: ↑b
, 
nat_plus: ℕ+
, 
le: A ≤ B
, 
listp: A List+
Lemmas referenced : 
decidable__le, 
list_wf, 
lastn-0, 
subtype_rel_list, 
top_wf, 
nat_properties, 
satisfiable-full-omega-tt, 
intformand_wf, 
intformle_wf, 
itermConstant_wf, 
itermVar_wf, 
intformless_wf, 
int_formula_prop_and_lemma, 
int_formula_prop_le_lemma, 
int_term_value_constant_lemma, 
int_term_value_var_lemma, 
int_formula_prop_less_lemma, 
int_formula_prop_wf, 
ge_wf, 
less_than_wf, 
equal-wf-T-base, 
nat_wf, 
colength_wf_list, 
less_than_transitivity1, 
less_than_irreflexivity, 
list-cases, 
list_accum_nil_lemma, 
product_subtype_list, 
spread_cons_lemma, 
intformeq_wf, 
itermAdd_wf, 
int_formula_prop_eq_lemma, 
int_term_value_add_lemma, 
intformnot_wf, 
int_formula_prop_not_lemma, 
le_wf, 
equal_wf, 
subtract_wf, 
itermSubtract_wf, 
int_term_value_subtract_lemma, 
subtype_base_sq, 
set_subtype_base, 
int_subtype_base, 
decidable__equal_int, 
list_accum_cons_lemma, 
length_of_nil_lemma, 
list_ind_nil_lemma, 
reduce_tl_cons_lemma, 
lt_int_wf, 
bool_wf, 
equal-wf-base, 
assert_wf, 
le_int_wf, 
bnot_wf, 
uiff_transitivity, 
eqtt_to_assert, 
assert_of_lt_int, 
eqff_to_assert, 
assert_functionality_wrt_uiff, 
bnot_of_lt_int, 
assert_of_le_int, 
lastn-nil, 
length_wf, 
append_nil_sq, 
lastn-cases, 
bnot_of_le_int, 
ifthenelse_wf, 
append_wf, 
cons_wf, 
nil_wf, 
tl_wf, 
squash_wf, 
true_wf, 
length_append, 
iff_weakening_equal, 
length-singleton, 
bool_cases_sqequal, 
bool_subtype_base, 
assert-bnot, 
length_tl, 
listp_properties, 
length-append, 
length_of_cons_lemma, 
add_nat_plus, 
length_wf_nat, 
nat_plus_wf, 
nat_plus_properties, 
decidable__lt, 
list_ind_cons_lemma, 
non_neg_length
Rules used in proof : 
sqequalSubstitution, 
sqequalTransitivity, 
computationStep, 
sqequalReflexivity, 
isect_memberFormation, 
introduction, 
cut, 
extract_by_obid, 
sqequalHypSubstitution, 
dependent_functionElimination, 
thin, 
hypothesisEquality, 
natural_numberEquality, 
hypothesis, 
unionElimination, 
sqequalAxiom, 
isectElimination, 
cumulativity, 
sqequalRule, 
isect_memberEquality, 
because_Cache, 
intEquality, 
universeEquality, 
applyEquality, 
independent_isectElimination, 
lambdaEquality, 
voidElimination, 
voidEquality, 
lambdaFormation, 
setElimination, 
rename, 
intWeakElimination, 
dependent_pairFormation, 
int_eqEquality, 
independent_pairFormation, 
computeAll, 
independent_functionElimination, 
promote_hyp, 
hypothesis_subsumption, 
productElimination, 
equalityTransitivity, 
equalitySymmetry, 
applyLambdaEquality, 
dependent_set_memberEquality, 
addEquality, 
baseClosed, 
instantiate, 
imageElimination, 
baseApply, 
closedConclusion, 
equalityElimination, 
imageMemberEquality
Latex:
\mforall{}[A:Type].  \mforall{}[n:\mBbbZ{}].  \mforall{}[L:A  List].
    (lastn(n;L)  \msim{}  accumulate  (with  value  b  and  list  item  x):
                                  if  ||b||  <z  n  then  b  @  [x]  else  tl(b  @  [x])  fi 
                                over  list:
                                    L
                                with  starting  value:
                                  []))
Date html generated:
2018_05_21-PM-06_42_55
Last ObjectModification:
2017_07_26-PM-04_54_30
Theory : general
Home
Index