Schemeã«ãã第ä¸ä¸å®å ¨æ§å®çã®å®è£
ãç¥ã®éçãã¨ããæ¬ãè²·ã£ãã第ä¸ä¸å®å ¨æ§å®çãLispã§å®è£ ããæ¹æ³ãè¼ã£ã¦ããããããããã®ã³ã¼ãã¯Schemeã§ã¯åããªãããã«æããã®ã§ãSchemeã§å®è£ ããã¦ã¿ããä¸å®å ¨æ§å®çã§ã¯ãã³ã¼ãä¸ã®å¼æ°ã«èªèº«ã®ã³ã¼ã渡ãã¦ãèªå·±è¨åçãªã²ã¼ãã«æGãæ§æãã¦è¨¼æããã®ã ããSå¼ã¯ã³ã¼ãããã ã®ãã¼ã¿ãªã®ã§ããããããã¨ãåºæ¥ãã®ãã¨æå¿ãããæ¬æ¸ã§ã¯ã第ä¸ä¸å®å ¨æ§å®ç以å¤ã«ããä¸åç¹ãåæ¢åé¡ã®Lispå®è£ ã示ããã¦ããããããã¯ããã§ç¤ºãã³ã¼ãã¨æ¬æ¸ãèªãã°Schemeã§å®è£ å¯è½ã«æãã
ãã ããæ¬æ¸ã¯é¢ç½ããã第ä¸ä¸å®å ¨æ§å®çã®èª¬æãªã©ã¯ã»ã¨ãã©ãªãããããããã第ä¸ä¸å®å ¨æ§å®çãç¥ããªãå ´åã¯ãç解ããã®ã¯é£ãããã§ã¯ããã
Schemeã«ããåå®è£
Schemeã§åå®è£ ãããã®ã¯ä»¥ä¸ã®éãã¨ãªãã
ã¾ããããxã¯xã§ãããã¨ããæã¯è¨¼æã§ããªããã¨ããgãèãããæãªã®ã§Så¼ã§è¿ãã
(define (L x y) (cons x (cons y '()))) ;; ãxã¯xã§ãããã¯è¨¼æã§ããªã (define g '(lambda (x) (L 'is-unprovable (L x x))))
ã¤ãã«ãSå¼ãè©ä¾¡ããããã®è£å©é¢æ°ã以ä¸ã®ããã«å®ç¾©ããã
;; (eval l) (define (eval0 l) (eval l '())) ;; 1ã¹ãããã ãè©ä¾¡ ;; (eval ((car l) (cdr l))) (define (eval1 l) (apply (eval0 (car l)) (cdr l)))
ã¨ããã¨ãã²ã¼ãã«æG = (g g)ã¯Schemeã§ã¯ä»¥ä¸ã®ããã«ãªãã
((eval0 g) g)
第ä¸ä¸å®å
¨æ§å®çã¯Gãnot Gã証æã§ããªããããªGãåå¨ããã¨ãããã®ãªã®ã§ã証æãã¦ã¿ãã
ã¾ããG = (is-unprovable G)ã¨ãªããã¨ã確èªããã
;; ã²ã¼ãã«æG ;; g(x) = ãxã¯xã§ãããã¯è¨¼æã§ããªã ;; G = g(g) = ããxã¯xã§ãããã¯è¨¼æã§ããªããã«èªèº«ãä»£å ¥ããæã¯è¨¼æã§ããªã (let ( (G ((eval0 g) g)) ) (print "\n以ä¸ã®ãããªGãèããï¼Gã¯ã²ã¼ãã«æï¼ã") (print "G = (g g)") (print " = " G) (print " ;; ä¸å¼ã®å¼æ°ãç°¡ç´") (print " ;; (L (car G) (eval1 (cadr G)))") (print " = " (L (car G) (eval1 (cadr G)))) (print " ;; Gã¨ä¸å¼ã®å¼æ°ãåã") (print " ;; (equal? G (eval1 (cadr G))) = " (equal? G (eval1 (cadr G)))) (print " = " (L 'is-unprovable 'G) " ; Gã¯è¨¼æã§ããªã") )
以ä¸ã®ãããªGãèããï¼Gã¯ã²ã¼ãã«æï¼ã G = (g g) = (is-unprovable ((lambda (x) (L 'is-unprovable (L x x))) (lambda (x) (L 'is-unprovable (L x x))))) ;; ä¸å¼ã®å¼æ°ãç°¡ç´ ;; (L (car G) (eval1 (cadr G))) = (is-unprovable (is-unprovable ((lambda (x) (L 'is-unprovable (L x x))) (lambda (x) (L 'is-unprovable (L x x)))))) ;; Gã¨ä¸å¼ã®å¼æ°ãåã ;; (equal? G (eval1 (cadr G))) = #t = (is-unprovable G) ; Gã¯è¨¼æã§ããªã
ãã¨ã¯ãä¸è¬çãªç¬¬ä¸ä¸å®å ¨æ§å®çéãã以ä¸ã®ããã«è¨¼æã§ããããã®é¨åã¯æ¬æ¸ã«ã¯è¼ã£ã¦ããªãã
Gã証æå¯è½ã¨ä»®å®ãããããã¨ã(is-unprovable G)ãæ£ããã¨è¨¼æå¯è½ã¨ãªããã¤ã¾ããGã¯è¨¼æã§ããªãã¨è¨¼æã§ãããã¨ã«ãªããèçæ³ããGã¯è¨¼æä¸å¯è½ã
not Gã証æå¯è½ã¨ä»®å®ãããããã§ã
not G = not (is-provable G) = (provable G)
ã¨ãªãããããããnot Gã証æå¯è½ã¨ãªãã¨ãGã証æå¯è½ã§ãªããã°ãªããªã®ã§çç¾ãèçæ³ããnot Gã証æä¸å¯è½ã
Gãnot Gã証æã§ããªããQ.E.D.
ã½ã¼ã¹ã³ã¼ã
ã½ã¼ã¹ã³ã¼ãã¯ä»¥ä¸ã«ããã
github.com
ããã¯ãGaucheã§å®è¡ãããã¨ãã§ããå®è¡ããã¨ä»¥ä¸ã®ããã«åºåãããã
$ gosh incomplete_theorem.scm 第ä¸ä¸å®å ¨æ§å®çï¼Gãnot Gã証æã§ããªããããªGãåå¨ãã g = (lambda (x) (L 'is-unprovable (L x x))) ã¨ããã 以ä¸ã®ãããªGãèããï¼Gã¯ã²ã¼ãã«æï¼ã G = (g g) = (is-unprovable ((lambda (x) (L 'is-unprovable (L x x))) (lambda (x) (L 'is-unprovable (L x x))))) ;; ä¸å¼ã®å¼æ°ãç°¡ç´ ;; (L (car G) (eval1 (cadr G))) = (is-unprovable (is-unprovable ((lambda (x) (L 'is-unprovable (L x x))) (lambda (x) (L 'is-unprovable (L x x)))))) ;; Gã¨ä¸å¼ã®å¼æ°ãåã ;; (equal? G (eval1 (cadr G))) = #t = (is-unprovable G) ; Gã¯è¨¼æã§ããªã Gã証æå¯è½ã¨ä»®å®ããã ããã¨ã(is-unprovable G)ãæ£ããã¨è¨¼æå¯è½ã¨ãªãã ã¤ã¾ããGã¯è¨¼æã§ããªãã¨è¨¼æã§ãããã¨ã«ãªãã èçæ³ããGã¯è¨¼æä¸å¯è½ã not Gã証æå¯è½ã¨ä»®å®ããã ããã§ã not G = not (is-provable G) = (provable G) ã¨ãªãã ãããããnot Gã証æå¯è½ã¨ãªãã¨ãGã証æå¯è½ã§ãªããã°ãªããªã®ã§çç¾ã èçæ³ããnot Gã証æä¸å¯è½ã Gãnot Gã証æã§ããªããQ.E.D.