Nuprl Lemma : last_index_cons

[T:Type]. ∀[P:T ⟶ 𝔹]. ∀[L:T List]. ∀[a:T].
  (last_index([a L];x.P[x])
  if 0 <last_index(L;x.P[x]) then last_index(L;x.P[x])
    if P[a] then 1
    else 0
    fi 
  ∈ ℤ)


Proof




Definitions occuring in Statement :  last_index: last_index(L;x.P[x]) cons: [a b] list: List ifthenelse: if then else fi  lt_int: i <j bool: 𝔹 uall: [x:A]. B[x] so_apply: x[s] function: x:A ⟶ B[x] add: m natural_number: $n int: universe: Type equal: t ∈ T
Definitions unfolded in proof :  uall: [x:A]. B[x] member: t ∈ T append: as bs all: x:A. B[x] so_lambda: so_lambda(x,y,z.t[x; y; z]) top: Top so_apply: x[s1;s2;s3] prop: squash: T so_lambda: λ2x.t[x] so_apply: x[s] subtype_rel: A ⊆B int_seg: {i..j-} last_index: last_index(L;x.P[x]) so_lambda: λ2y.t[x; y] so_apply: x[s1;s2] pi2: snd(t) implies:  Q bool: 𝔹 unit: Unit it: btrue: tt ifthenelse: if then else fi  uiff: uiff(P;Q) and: P ∧ Q uimplies: supposing a bfalse: ff exists: x:A. B[x] or: P ∨ Q sq_type: SQType(T) guard: {T} bnot: ¬bb assert: b false: False true: True
Lemmas referenced :  last_index_append cons_wf nil_wf list_ind_cons_lemma list_ind_nil_lemma length_of_cons_lemma length_of_nil_lemma equal_wf squash_wf true_wf ifthenelse_wf lt_int_wf last_index_wf int_seg_wf length_wf list_accum_cons_lemma list_accum_nil_lemma bool_wf eqtt_to_assert eqff_to_assert bool_cases_sqequal subtype_base_sq bool_subtype_base assert-bnot list_wf
Rules used in proof :  sqequalSubstitution sqequalTransitivity computationStep sqequalReflexivity isect_memberFormation introduction cut extract_by_obid sqequalHypSubstitution isectElimination thin because_Cache cumulativity hypothesisEquality hypothesis sqequalRule dependent_functionElimination isect_memberEquality voidElimination voidEquality hyp_replacement equalitySymmetry applyEquality lambdaEquality imageElimination equalityTransitivity intEquality natural_numberEquality functionExtensionality setElimination rename addEquality lambdaFormation unionElimination equalityElimination productElimination independent_isectElimination dependent_pairFormation promote_hyp instantiate independent_functionElimination imageMemberEquality baseClosed axiomEquality functionEquality universeEquality

Latex:
\mforall{}[T:Type].  \mforall{}[P:T  {}\mrightarrow{}  \mBbbB{}].  \mforall{}[L:T  List].  \mforall{}[a:T].
    (last\_index([a  /  L];x.P[x])
    =  if  0  <z  last\_index(L;x.P[x])  then  1  +  last\_index(L;x.P[x])
        if  P[a]  then  1
        else  0
        fi  )



Date html generated: 2018_05_21-PM-07_00_28
Last ObjectModification: 2017_07_26-PM-05_02_56

Theory : general


Home Index