default.txt 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. ::: ## Lambda calculus
  2. environ
  3. vocabularies LAMBDA,
  4. NUMBERS,
  5. NAT_1, XBOOLE_0, SUBSET_1, FINSEQ_1, XXREAL_0, CARD_1,
  6. ARYTM_1, ARYTM_3, TARSKI, RELAT_1, ORDINAL4, FUNCOP_1;
  7. :: etc...
  8. begin
  9. reserve D for DecoratedTree,
  10. p,q,r for FinSequence of NAT,
  11. x for set;
  12. definition
  13. let D;
  14. attr D is LambdaTerm-like means
  15. (dom D qua Tree) is finite &
  16. ::> *143,306
  17. for r st r in dom D holds
  18. r is FinSequence of {0,1} &
  19. r^<*0*> in dom D implies D.r = 0;
  20. end;
  21. registration
  22. cluster LambdaTerm-like for DecoratedTree of NAT;
  23. existence;
  24. ::> *4
  25. end;
  26. definition
  27. mode LambdaTerm is LambdaTerm-like DecoratedTree of NAT;
  28. end;
  29. ::: Then we extend this ordinary one-step beta reduction, that is,
  30. ::: any subterm is also allowed to reduce.
  31. definition
  32. let M,N;
  33. pred M beta N means
  34. ex p st
  35. M|p beta_shallow N|p &
  36. for q st not p is_a_prefix_of q holds
  37. [r,x] in M iff [r,x] in N;
  38. end;
  39. theorem Th4:
  40. ProperPrefixes (v^<*x*>) = ProperPrefixes v \/ {v}
  41. proof
  42. thus ProperPrefixes (v^<*x*>) c= ProperPrefixes v \/ {v}
  43. proof
  44. let y;
  45. assume y in ProperPrefixes (v^<*x*>);
  46. then consider v1 such that
  47. A1: y = v1 and
  48. A2: v1 is_a_proper_prefix_of v^<*x*> by TREES_1:def 2;
  49. v1 is_a_prefix_of v & v1 <> v or v1 = v by A2,TREES_1:9;
  50. then
  51. v1 is_a_proper_prefix_of v or v1 in {v} by TARSKI:def 1,XBOOLE_0:def 8;
  52. then y in ProperPrefixes v or y in {v} by A1,TREES_1:def 2;
  53. hence thesis by XBOOLE_0:def 3;
  54. end;
  55. let y;
  56. assume y in ProperPrefixes v \/ {v};
  57. then A3: y in ProperPrefixes v or y in {v} by XBOOLE_0:def 3;
  58. A4: now
  59. assume y in ProperPrefixes v;
  60. then consider v1 such that
  61. A5: y = v1 and
  62. A6: v1 is_a_proper_prefix_of v by TREES_1:def 2;
  63. v is_a_prefix_of v^<*x*> by TREES_1:1;
  64. then v1 is_a_proper_prefix_of v^<*x*> by A6,XBOOLE_1:58;
  65. hence thesis by A5,TREES_1:def 2;
  66. end;
  67. v^{} = v by FINSEQ_1:34;
  68. then
  69. v is_a_prefix_of v^<*x*> & v <> v^<*x*> by FINSEQ_1:33,TREES_1:1;
  70. then v is_a_proper_prefix_of v^<*x*> by XBOOLE_0:def 8;
  71. then y in ProperPrefixes v or y = v & v in ProperPrefixes (v^<*x*>)
  72. by A3,TARSKI:def 1,TREES_1:def 2;
  73. hence thesis by A4;
  74. end;