Nuprl Lemma : term-accum_wf_wfterm
∀[opr,P:Type]. ∀[sort:term(opr) ⟶ ℕ]. ∀[arity:opr ⟶ ((ℕ × ℕ) List)]. ∀[R:P ⟶ wfterm(opr;sort;arity) ⟶ ℙ].
∀[Q:P
    ⟶ f:opr
    ⟶ vs:(varname() List)
    ⟶ {L:(t:wfterm(opr;sort;arity) × p:P × R[p;t]) List| 
        ||L|| < ||arity f||
        ∧ (||vs|| = (fst(arity f[||L||])) ∈ ℤ)
        ∧ (∀i:ℕ||L||. ((sort (fst(L[i]))) = (snd(arity f[i])) ∈ ℤ))} 
    ⟶ P]. ∀[varcase:p:P ⟶ v:{v:varname()| ¬(v = nullvar() ∈ varname())}  ⟶ R[p;varterm(v)]].
∀[mktermcase:p:P
             ⟶ f:opr
             ⟶ bts:wf-bound-terms(opr;sort;arity;f)
             ⟶ L:{L:(t:wfterm(opr;sort;arity) × p:P × R[p;t]) List| 
                   (||L|| = ||bts|| ∈ ℤ)
                   ∧ (∀i:ℕ||L||. ((fst(L[i])) = (snd(bts[i])) ∈ term(opr)))
                   ∧ (∀i:ℕ||L||. ((fst(snd(L[i]))) = Q[p;f;fst(bts[i]);firstn(i;L)] ∈ P))} 
             ⟶ R[p;mkwfterm(f;bts)]]. ∀[t:wfterm(opr;sort;arity)]. ∀[p:P].
  (term-accum(t with p)
   p,f,vs,tr.Q[p;f;vs;tr]
   varterm(x) with p 
⇒ varcase[p;x]
   mkterm(f,bts) with p 
⇒ trs.mktermcase[p;f;bts;trs] ∈ R[p;t])
Proof
Definitions occuring in Statement : 
mkwfterm: mkwfterm(f;bts)
, 
wf-bound-terms: wf-bound-terms(opr;sort;arity;f)
, 
wfterm: wfterm(opr;sort;arity)
, 
term-accum: term-accum, 
varterm: varterm(v)
, 
term: term(opr)
, 
nullvar: nullvar()
, 
varname: varname()
, 
firstn: firstn(n;as)
, 
select: L[n]
, 
length: ||as||
, 
list: T List
, 
int_seg: {i..j-}
, 
nat: ℕ
, 
less_than: a < b
, 
uall: ∀[x:A]. B[x]
, 
prop: ℙ
, 
so_apply: x[s1;s2;s3;s4]
, 
so_apply: x[s1;s2]
, 
pi1: fst(t)
, 
pi2: snd(t)
, 
all: ∀x:A. B[x]
, 
not: ¬A
, 
and: P ∧ Q
, 
member: t ∈ T
, 
set: {x:A| B[x]} 
, 
apply: f a
, 
function: x:A ⟶ B[x]
, 
product: x:A × B[x]
, 
natural_number: $n
, 
int: ℤ
, 
universe: Type
, 
equal: s = t ∈ T
Definitions unfolded in proof : 
varterm: varterm(v)
, 
wf-term: wf-term(arity;sort;t)
, 
less_than': less_than'(a;b)
, 
guard: {T}
, 
int_iseg: {i...j}
, 
cand: A c∧ B
, 
wf-bound-terms: wf-bound-terms(opr;sort;arity;f)
, 
bfalse: ff
, 
true: True
, 
rev_implies: P 
⇐ Q
, 
iff: P 
⇐⇒ Q
, 
isl: isl(x)
, 
squash: ↓T
, 
less_than: a < b
, 
pi2: snd(t)
, 
lelt: i ≤ j < k
, 
int_seg: {i..j-}
, 
pi1: fst(t)
, 
nat: ℕ
, 
exists: ∃x:A. B[x]
, 
satisfiable_int_formula: satisfiable_int_formula(fmla)
, 
implies: P 
⇒ Q
, 
not: ¬A
, 
le: A ≤ B
, 
false: False
, 
or: P ∨ Q
, 
decidable: Dec(P)
, 
ge: i ≥ j 
, 
and: P ∧ Q
, 
subtype_rel: A ⊆r B
, 
btrue: tt
, 
ifthenelse: if b then t else f fi 
, 
assert: ↑b
, 
all: ∀x:A. B[x]
, 
so_apply: x[s1;s2;s3;s4]
, 
so_apply: x[s]
, 
wfterm: wfterm(opr;sort;arity)
, 
so_apply: x[s1;s2]
, 
so_lambda: λ2x.t[x]
, 
prop: ℙ
, 
uimplies: b supposing a
, 
member: t ∈ T
, 
uall: ∀[x:A]. B[x]
, 
uiff: uiff(P;Q)
, 
it: ⋅
, 
unit: Unit
, 
bool: 𝔹
, 
l_member: (x ∈ l)
, 
bound-term: bound-term(opr)
, 
mkwfterm: mkwfterm(f;bts)
, 
sq_type: SQType(T)
, 
respects-equality: respects-equality(S;T)
, 
rev_uimplies: rev_uimplies(P;Q)
, 
mkterm: mkterm(opr;bts)
, 
so_lambda: λ2x y.t[x; y]
, 
so_lambda: so_lambda4, 
coterm-fun: coterm-fun(opr;T)
, 
isvarterm: isvarterm(t)
, 
outr: outr(x)
, 
term-bts: term-bts(t)
, 
wfbts: wfbts(t)
, 
sq_stable: SqStable(P)
, 
let: let, 
nil: []
, 
select: L[n]
, 
term-opr: term-opr(t)
, 
bnot: ¬bb
, 
cons: [a / b]
Lemmas referenced : 
varterm_wf, 
nullvar_wf, 
mkwfterm_wf, 
istype-universe, 
true_wf, 
squash_wf, 
equal_wf, 
istype-false, 
int_seg_subtype_nat, 
top_wf, 
subtype_rel_list, 
select-firstn, 
length_firstn, 
int_formula_prop_eq_lemma, 
intformeq_wf, 
iff_weakening_equal, 
istype-le, 
lelt_wf, 
subtype_rel_sets_simple, 
length_firstn_eq, 
firstn_wf, 
wfterm_wf, 
istype-void, 
istype-true, 
decidable_wf, 
subtype_rel_self, 
list_wf, 
decidable__assert, 
decidable__all_int_seg, 
decidable__equal_int, 
varname_wf, 
length_wf_nat, 
istype-less_than, 
int_formula_prop_less_lemma, 
intformless_wf, 
decidable__lt, 
int_seg_properties, 
int_seg_wf, 
all_wf, 
int_subtype_base, 
le_wf, 
set_subtype_base, 
int_formula_prop_wf, 
int_term_value_var_lemma, 
int_term_value_constant_lemma, 
int_formula_prop_le_lemma, 
int_formula_prop_not_lemma, 
int_formula_prop_and_lemma, 
istype-int, 
itermVar_wf, 
itermConstant_wf, 
intformle_wf, 
intformnot_wf, 
intformand_wf, 
full-omega-unsat, 
decidable__le, 
non_neg_length, 
select_wf, 
istype-nat, 
pi1_wf, 
equal-wf-base, 
nat_wf, 
length_wf, 
less_than_wf, 
decidable__and2, 
wf_term_var_lemma, 
term_wf, 
istype-assert, 
wf-term_wf, 
assert_wf, 
isect_wf, 
term-accum_wf, 
assert_of_bnot, 
eqff_to_assert, 
uiff_transitivity, 
eqtt_to_assert, 
not_wf, 
bnot_wf, 
bool_wf, 
equal-wf-T-base, 
l_member_wf, 
list-subtype, 
bfalse_wf, 
btrue_wf, 
assert_functionality_wrt_uiff, 
nat_properties, 
uimplies_subtype, 
subtype_rel_dep_function, 
bound-term_wf, 
mkterm_wf, 
bool_subtype_base, 
subtype_base_sq, 
assert_elim, 
assert-wf-mkterm, 
respects-equality-set-trivial2, 
iff_imp_equal_bool, 
assert_of_tt, 
int_term_value_add_lemma, 
itermAdd_wf, 
pi2_wf, 
term-size_wf, 
lsum_wf, 
term_accum_mkterm_lemma, 
term_size_mkterm_lemma, 
term_accum_varterm_lemma, 
term_size_var_lemma, 
coterm-fun_wf, 
subtype_rel_weakening, 
term-ext, 
int_term_value_subtract_lemma, 
itermSubtract_wf, 
subtract_wf, 
subtract-1-ge-0, 
ge_wf, 
subtype_rel_product, 
subtype_rel_set, 
isvarterm_wf, 
wfbts_wf, 
term-size-positive, 
false_wf, 
add-is-int-iff, 
select_member, 
sq_stable__le, 
summand-le-lsum, 
firstn_all, 
list_accum_append, 
first0, 
list_accum_cons_lemma, 
list_accum_nil_lemma, 
firstn_length, 
firstn_decomp, 
istype-base, 
stuck-spread, 
length_of_nil_lemma, 
nil_wf, 
length-append, 
length_of_cons_lemma, 
cons_wf, 
append_wf, 
iff_weakening_uiff, 
assert-bnot, 
bool_cases_sqequal, 
assert_of_lt_int, 
lt_int_wf, 
select-append
Rules used in proof : 
universeEquality, 
baseClosed, 
imageMemberEquality, 
setIsType, 
productIsType, 
functionEquality, 
functionExtensionality, 
instantiate, 
functionIsType, 
sqequalBase, 
intEquality, 
imageElimination, 
rename, 
setElimination, 
equalitySymmetry, 
equalityTransitivity, 
equalityIstype, 
inhabitedIsType, 
voidElimination, 
independent_pairFormation, 
int_eqEquality, 
dependent_pairFormation_alt, 
independent_functionElimination, 
approximateComputation, 
natural_numberEquality, 
productElimination, 
unionElimination, 
independent_isectElimination, 
isect_memberEquality_alt, 
closedConclusion, 
because_Cache, 
isectEquality, 
productEquality, 
lambdaFormation_alt, 
Error :memTop, 
dependent_functionElimination, 
universeIsType, 
dependent_set_memberEquality_alt, 
applyEquality, 
sqequalRule, 
lambdaEquality_alt, 
hypothesisEquality, 
thin, 
isectElimination, 
sqequalHypSubstitution, 
hypothesis, 
isect_memberFormation_alt, 
sqequalReflexivity, 
computationStep, 
sqequalTransitivity, 
sqequalSubstitution, 
extract_by_obid, 
introduction, 
cut, 
equalityElimination, 
isectIsType, 
dependent_pairEquality_alt, 
setEquality, 
independent_pairEquality, 
cumulativity, 
applyLambdaEquality, 
hyp_replacement, 
addEquality, 
hypothesis_subsumption, 
promote_hyp, 
functionIsTypeImplies, 
axiomEquality, 
intWeakElimination, 
axiomSqEquality, 
baseApply, 
pointwiseFunctionality, 
minusEquality
Latex:
\mforall{}[opr,P:Type].  \mforall{}[sort:term(opr)  {}\mrightarrow{}  \mBbbN{}].  \mforall{}[arity:opr  {}\mrightarrow{}  ((\mBbbN{}  \mtimes{}  \mBbbN{})  List)].  \mforall{}[R:P
                                                                                                                                                      {}\mrightarrow{}  wfterm(opr;sort;arity)
                                                                                                                                                      {}\mrightarrow{}  \mBbbP{}].
\mforall{}[Q:P
        {}\mrightarrow{}  f:opr
        {}\mrightarrow{}  vs:(varname()  List)
        {}\mrightarrow{}  \{L:(t:wfterm(opr;sort;arity)  \mtimes{}  p:P  \mtimes{}  R[p;t])  List| 
                ||L||  <  ||arity  f||
                \mwedge{}  (||vs||  =  (fst(arity  f[||L||])))
                \mwedge{}  (\mforall{}i:\mBbbN{}||L||.  ((sort  (fst(L[i])))  =  (snd(arity  f[i]))))\} 
        {}\mrightarrow{}  P].  \mforall{}[varcase:p:P  {}\mrightarrow{}  v:\{v:varname()|  \mneg{}(v  =  nullvar())\}    {}\mrightarrow{}  R[p;varterm(v)]].
\mforall{}[mktermcase:p:P
                          {}\mrightarrow{}  f:opr
                          {}\mrightarrow{}  bts:wf-bound-terms(opr;sort;arity;f)
                          {}\mrightarrow{}  L:\{L:(t:wfterm(opr;sort;arity)  \mtimes{}  p:P  \mtimes{}  R[p;t])  List| 
                                      (||L||  =  ||bts||)
                                      \mwedge{}  (\mforall{}i:\mBbbN{}||L||.  ((fst(L[i]))  =  (snd(bts[i]))))
                                      \mwedge{}  (\mforall{}i:\mBbbN{}||L||.  ((fst(snd(L[i])))  =  Q[p;f;fst(bts[i]);firstn(i;L)]))\} 
                          {}\mrightarrow{}  R[p;mkwfterm(f;bts)]].  \mforall{}[t:wfterm(opr;sort;arity)].  \mforall{}[p:P].
    (term-accum(t  with  p)
      p,f,vs,tr.Q[p;f;vs;tr]
      varterm(x)  with  p  {}\mRightarrow{}  varcase[p;x]
      mkterm(f,bts)  with  p  {}\mRightarrow{}  trs.mktermcase[p;f;bts;trs]  \mmember{}  R[p;t])
Date html generated:
2020_05_19-PM-10_00_09
Last ObjectModification:
2020_03_11-PM-09_42_33
Theory : terms
Home
Index