Nuprl Lemma : longest-prefix-list_accum
∀[T,B:Type]. ∀[as:T List]. ∀[P:B ⟶ 𝔹]. ∀[b0:B]. ∀[acc:B ⟶ T ⟶ B]. ∀[a:T].
  (longest-prefix(λL.P[accumulate (with value t and list item a):
                        acc[t;a]
                       over list:
                         L
                       with starting value:
                        b0)];[a / as]) ~ if null(longest-prefix(λL.P[accumulate (with value t and list item a):
                                                                      acc[t;a]
                                                                     over list:
                                                                       L
                                                                     with starting value:
                                                                      acc[b0;a])];as))
  then if (¬bnull(as)) ∧b P[acc[b0;a]] then [a] else [] fi 
  else [a / 
        longest-prefix(λL.P[accumulate (with value t and list item a):
                             acc[t;a]
                            over list:
                              L
                            with starting value:
                             acc[b0;a])];as)]
  fi )
Proof
Definitions occuring in Statement : 
longest-prefix: longest-prefix(P;L)
, 
null: null(as)
, 
list_accum: list_accum, 
cons: [a / b]
, 
nil: []
, 
list: T List
, 
band: p ∧b q
, 
bnot: ¬bb
, 
ifthenelse: if b then t else f fi 
, 
bool: 𝔹
, 
uall: ∀[x:A]. B[x]
, 
so_apply: x[s1;s2]
, 
so_apply: x[s]
, 
lambda: λx.A[x]
, 
function: x:A ⟶ B[x]
, 
universe: Type
, 
sqequal: s ~ t
Definitions unfolded in proof : 
longest-prefix: longest-prefix(P;L)
, 
all: ∀x:A. B[x]
, 
member: t ∈ T
, 
top: Top
, 
so_lambda: λ2x y.t[x; y]
, 
so_apply: x[s1;s2]
, 
ifthenelse: if b then t else f fi 
, 
bfalse: ff
, 
uall: ∀[x:A]. B[x]
, 
so_apply: x[s]
, 
listp: A List+
, 
implies: P 
⇒ Q
, 
let: let, 
subtype_rel: A ⊆r B
, 
uimplies: b supposing a
, 
bool: 𝔹
, 
unit: Unit
, 
it: ⋅
, 
btrue: tt
, 
uiff: uiff(P;Q)
, 
and: P ∧ Q
, 
bnot: ¬bb
, 
band: p ∧b q
, 
exists: ∃x:A. B[x]
, 
prop: ℙ
, 
or: P ∨ Q
, 
sq_type: SQType(T)
, 
guard: {T}
, 
assert: ↑b
, 
false: False
, 
not: ¬A
Lemmas referenced : 
null_cons_lemma, 
list_accum_cons_lemma, 
reduce_hd_cons_lemma, 
reduce_tl_cons_lemma, 
list_accum_nil_lemma, 
longest-prefix_wf, 
list_accum_wf, 
listp_wf, 
null_wf3, 
subtype_rel_list, 
top_wf, 
bool_wf, 
eqtt_to_assert, 
assert_of_null, 
eqff_to_assert, 
equal_wf, 
bool_cases_sqequal, 
subtype_base_sq, 
bool_subtype_base, 
assert-bnot, 
equal-wf-T-base, 
list_wf
Rules used in proof : 
sqequalSubstitution, 
sqequalRule, 
sqequalTransitivity, 
computationStep, 
sqequalReflexivity, 
cut, 
introduction, 
extract_by_obid, 
sqequalHypSubstitution, 
dependent_functionElimination, 
thin, 
isect_memberEquality, 
voidElimination, 
voidEquality, 
hypothesis, 
isectElimination, 
cumulativity, 
hypothesisEquality, 
lambdaEquality, 
applyEquality, 
functionExtensionality, 
setElimination, 
rename, 
because_Cache, 
lambdaFormation, 
independent_isectElimination, 
unionElimination, 
equalityElimination, 
equalityTransitivity, 
equalitySymmetry, 
productElimination, 
dependent_pairFormation, 
promote_hyp, 
instantiate, 
independent_functionElimination, 
baseClosed, 
functionEquality, 
universeEquality, 
isect_memberFormation, 
sqequalAxiom
Latex:
\mforall{}[T,B:Type].  \mforall{}[as:T  List].  \mforall{}[P:B  {}\mrightarrow{}  \mBbbB{}].  \mforall{}[b0:B].  \mforall{}[acc:B  {}\mrightarrow{}  T  {}\mrightarrow{}  B].  \mforall{}[a:T].
    (longest-prefix(\mlambda{}L.P[accumulate  (with  value  t  and  list  item  a):
                                                acc[t;a]
                                              over  list:
                                                  L
                                              with  starting  value:
                                                b0)];[a  /  as]) 
    \msim{}  if  null(longest-prefix(\mlambda{}L.P[accumulate  (with  value  t  and  list  item  a):
                                                                  acc[t;a]
                                                                over  list:
                                                                    L
                                                                with  starting  value:
                                                                  acc[b0;a])];as))
    then  if  (\mneg{}\msubb{}null(as))  \mwedge{}\msubb{}  P[acc[b0;a]]  then  [a]  else  []  fi 
    else  [a  / 
                longest-prefix(\mlambda{}L.P[accumulate  (with  value  t  and  list  item  a):
                                                          acc[t;a]
                                                        over  list:
                                                            L
                                                        with  starting  value:
                                                          acc[b0;a])];as)]
    fi  )
Date html generated:
2018_05_21-PM-06_42_10
Last ObjectModification:
2017_07_26-PM-04_54_10
Theory : general
Home
Index