Nuprl Lemma : accum-class-programmable
∀[Info,A,B:Type]. ∀[X:EClass(A)]. ∀[base:A ─→ B]. ∀[f:B ─→ A ─→ B].
  (accum-class(b,a.f[b;a];a.base[a];X)
  = λB,r. if (#(B 0) =z 1)
         then if (#(r) =z 1) then {f[only(r);only(B 0)]} else {base[only(B 0)]} fi 
         else {}
         fi |λi.X,(self)'|
  ∈ EClass(B))
Proof
Definitions occuring in Statement : 
rec-combined-class: f|X,(self)'|
, 
accum-class: accum-class(a,x.f[a; x];x.base[x];X)
, 
eclass: EClass(A[eo; e])
, 
ifthenelse: if b then t else f fi 
, 
eq_int: (i =z j)
, 
uall: ∀[x:A]. B[x]
, 
so_apply: x[s1;s2]
, 
so_apply: x[s]
, 
apply: f a
, 
lambda: λx.A[x]
, 
function: x:A ─→ B[x]
, 
natural_number: $n
, 
universe: Type
, 
equal: s = t ∈ T
, 
bag-only: only(bs)
, 
bag-size: #(bs)
, 
single-bag: {x}
, 
empty-bag: {}
Lemmas : 
rec-combined-class_wf, 
false_wf, 
le_wf, 
int_seg_wf, 
eq_int_wf, 
bag-size_wf, 
lelt_wf, 
nat_wf, 
bool_wf, 
eqtt_to_assert, 
assert_of_eq_int, 
single-bag_wf, 
bag-only_wf2, 
single-valued-bag-if-le1, 
le_weakening, 
decidable__lt, 
le_antisymmetry_iff, 
add_functionality_wrt_le, 
add-commutes, 
zero-add, 
le-add-cancel, 
add-zero, 
eqff_to_assert, 
equal_wf, 
bool_cases_sqequal, 
subtype_base_sq, 
bool_subtype_base, 
assert-bnot, 
neg_assert_of_eq_int, 
not-equal-2, 
empty-bag_wf, 
bag_wf, 
eclass_wf, 
es-E_wf, 
event-ordering+_subtype, 
event-ordering+_wf, 
squash_wf, 
true_wf, 
in-eclass_wf, 
es-interface-subtype_rel2, 
top_wf, 
primed-class_wf, 
eclass-val_wf, 
bag_size_single_lemma, 
bag_size_empty_lemma, 
iff_weakening_equal, 
assert_wf, 
es-interface-extensionality, 
accum-class_wf, 
is-accum-class, 
accum-class-val, 
es-causl-swellfnd, 
nat_properties, 
less_than_transitivity1, 
less_than_irreflexivity, 
ge_wf, 
less_than_wf, 
int_seg_subtype-nat, 
decidable__le, 
subtract_wf, 
not-ge-2, 
less-iff-le, 
condition-implies-le, 
minus-one-mul, 
minus-add, 
minus-minus, 
add-associates, 
add-swap, 
decidable__equal_int, 
subtype_rel-int_seg, 
int_seg_properties, 
zero-le-nat, 
es-causl_wf, 
le-add-cancel-alt, 
not-le-2, 
sq_stable__le, 
add-mul-special, 
zero-mul, 
accum_list_wf, 
es-E-interface_wf, 
Id_wf, 
es-loc_wf, 
assert_elim, 
es-interface-predecessors_wf, 
es-interface-predecessors-nonempty, 
bag_only_single_lemma, 
single-valued-bag-single, 
single-valued-bag_wf, 
set_wf, 
sq_stable__assert, 
length_wf, 
list_wf, 
es-interface-predecessors-step, 
es-prior-interface_wf1, 
subtype_top, 
eclass-val_wf2, 
es-prior-interface_wf, 
es-is-prior-interface, 
es-E-interface-property, 
es-locl_wf, 
accum_list_cons_lemma, 
list_accum_nil_lemma, 
es-prior-interface-causl, 
append_wf, 
subtype_rel_list, 
cons_wf, 
nil_wf, 
length_nil, 
non_neg_length, 
length_wf_nil, 
length_wf_nat, 
length_cons, 
length_append, 
es-prior-interface-same, 
event-ordering+_cumulative2, 
list-cases, 
list_ind_nil_lemma, 
product_subtype_list, 
list_ind_cons_lemma, 
length_of_nil_lemma, 
list_accum_append, 
list_accum_cons_lemma, 
list_accum_wf, 
primed-class-prior-val, 
and_wf, 
not_assert_elim, 
btrue_neq_bfalse
Latex:
\mforall{}[Info,A,B:Type].  \mforall{}[X:EClass(A)].  \mforall{}[base:A  {}\mrightarrow{}  B].  \mforall{}[f:B  {}\mrightarrow{}  A  {}\mrightarrow{}  B].
    (accum-class(b,a.f[b;a];a.base[a];X)
    =  \mlambda{}B,r.  if  (\#(B  0)  =\msubz{}  1)
                  then  if  (\#(r)  =\msubz{}  1)  then  \{f[only(r);only(B  0)]\}  else  \{base[only(B  0)]\}  fi 
                  else  \{\}
                  fi  |\mlambda{}i.X,(self)'|)
Date html generated:
2015_07_21-PM-04_23_09
Last ObjectModification:
2015_02_04-PM-06_02_59
Home
Index