Gödel's masterstroke was to make a sentence point at itself. The result is the famous line G: "This statement has no proof." Step through the construction below, then ask the only two questions that matter — is G true, and can the system prove it?
<p class="hint">Gödel built a sentence that talks about its <b>own</b> provability.
Step through the construction, then ask whether the system can prove it. Watch both
answers collapse into one: a sentence that is <b>true</b> but has <b>no proof</b>.</p>
<div class="stage" id="stage">
<div class="line" id="lineG">G : “This statement has no proof.”</div>
<div class="num" id="num"></div>
</div>
<div class="branches" id="branches">
<div class="branch" id="bProve">
<div class="bh">If the system PROVES G…</div>
<div class="bb" id="bbProve"></div>
</div>
<div class="branch" id="bRefute">
<div class="bh">If the system DISPROVES G…</div>
<div class="bb" id="bbRefute"></div>
</div>
</div>
<div class="verdict" id="verdict"></div>
<div class="btns">
<button id="encode" type="button">1 · Encode G as a number</button>
<button id="ask" type="button">2 · Ask: can the system prove G?</button>
<button id="reset" type="button" class="ghost">Reset</button>
</div>
* { box-sizing: border-box; }
body { font-family: system-ui, sans-serif; color: #222; margin: 0; }
.hint { font-size: .9rem; color: #444; margin: 0 0 .8rem; line-height: 1.45; }
.stage { background: #e8eef3; border: 1px solid #cdd9e3; border-radius: 10px;
padding: 1rem; text-align: center; margin-bottom: .8rem; }
.line { font: 600 1.15rem ui-monospace, monospace; color: #1d3557; }
.num { font: 500 .85rem ui-monospace, monospace; color: #5a7088; margin-top: .5rem;
min-height: 1.2em; transition: opacity .2s; }
.branches { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: .6rem; }
.branch { border: 1px solid #cdd9e3; border-radius: 10px; padding: .7rem; background: #fff;
opacity: .35; transition: opacity .25s; }
.branch.lit { opacity: 1; }
.bh { font: 700 .8rem system-ui; color: #1d3557; margin-bottom: .35rem; }
.bb { font-size: .85rem; color: #444; line-height: 1.4; min-height: 2.2em; }
.bb .bad { color: #c92f3c; font-weight: 600; }
.verdict { font-size: 1rem; font-weight: 700; margin: .4rem 0 .8rem; min-height: 1.4em;
text-align: center; color: #0a7d33; }
.btns { display: flex; gap: .5rem; flex-wrap: wrap; }
button { font: 600 14px system-ui, sans-serif; padding: .45rem .9rem; border: 1px solid #1d3557;
background: #1d3557; color: #fff; border-radius: 8px; cursor: pointer; }
button.ghost { background: #fff; color: #1d3557; }
button:disabled { opacity: .4; cursor: not-allowed; }
@media (max-width: 480px) { .branches { grid-template-columns: 1fr; } }
const fmt = (s, v) => s.replace(/%(\w+)%/g, (_, k) => String(v[k] ?? ''));
// Gödel’s First Incompleteness Theorem, made tangible.
//
// G is the self-referential sentence: "This statement has no proof."
// We model a SOUND system: it never proves a false statement, and never
// disproves a true one. The demo walks the two possible behaviours and shows
// that BOTH lead to contradiction unless the system simply leaves G alone —
//
// "encode" illustrates Gödel numbering: turn the symbols of G into a single
// number so the sentence can refer to itself by that number.
const SENTENCE = 'This statement has no proof.';
// A tiny, deterministic Gödel-style code: map each character to a prime base
// and combine. We only need a stable, reproducible big number for the demo.
function godelNumber(s) {
// product of prime^code is astronomically large, so we fold into a readable
// 18-digit fingerprint instead — the point is "a unique number", not its size.
let h = 1n;
const primes = [2n,3n,5n,7n,11n,13n,17n,19n,23n,29n,31n,37n];
for (let i = 0; i < s.length; i++) {
const p = primes[i % primes.length];
h = (h * p + BigInt(s.charCodeAt(i))) % 1000000000000000000n;
}
return h.toString();
}
const el = (id) => document.getElementById(id);
function reset() {
el('num').textContent = '';
el('bbProve').innerHTML = '';
el('bbRefute').innerHTML = '';
el('bProve').classList.remove('lit');
el('bRefute').classList.remove('lit');
el('verdict').textContent = '';
el('ask').disabled = true;
el('encode').disabled = false;
}
el('encode').addEventListener('click', () => {
const g = godelNumber(SENTENCE);
el('num').textContent = fmt('Gödel number of G = %g% → G now says: "the formula numbered %g% has no proof."', { g: g });
el('ask').disabled = false;
el('encode').disabled = true;
});
el('ask').addEventListener('click', () => {
el('bProve').classList.add('lit');
el('bRefute').classList.add('lit');
el('bbProve').innerHTML = '…then it proved something that claims to be unprovable. G would be <span class="bad">false</span>, but a sound system never proves falsehoods. <span class="bad">Contradiction.</span>';
el('bbRefute').innerHTML = '…then it proved “G has a proof”, i.e. G is <span class="bad">false</span>. But then there IS a proof of G, so the system both proves and disproves G. <span class="bad">Contradiction.</span>';
el('verdict').textContent = 'So a consistent system can neither prove nor disprove G — yet G is TRUE. Truth outran proof.';
el('ask').disabled = true;
});
el('reset').addEventListener('click', reset);
reset();
// Self-check logged for the curious: the Gödel number is deterministic.
console.log('G =', SENTENCE, '| Gödel number =', godelNumber(SENTENCE));
<p class="hint">Gödel built a sentence that talks about its <b>own</b> provability.
Step through the construction, then ask whether the system can prove it. Watch both
answers collapse into one: a sentence that is <b>true</b> but has <b>no proof</b>.</p>
<div class="stage" id="stage">
<div class="line" id="lineG">G : “This statement has no proof.”</div>
<div class="num" id="num"></div>
</div>
<div class="branches" id="branches">
<div class="branch" id="bProve">
<div class="bh">If the system PROVES G…</div>
<div class="bb" id="bbProve"></div>
</div>
<div class="branch" id="bRefute">
<div class="bh">If the system DISPROVES G…</div>
<div class="bb" id="bbRefute"></div>
</div>
</div>
<div class="verdict" id="verdict"></div>
<div class="btns">
<button id="encode" type="button">1 · Encode G as a number</button>
<button id="ask" type="button">2 · Ask: can the system prove G?</button>
<button id="reset" type="button" class="ghost">Reset</button>
</div>
* { box-sizing: border-box; }
body { font-family: system-ui, sans-serif; color: #222; margin: 0; }
.hint { font-size: .9rem; color: #444; margin: 0 0 .8rem; line-height: 1.45; }
.stage { background: #e8eef3; border: 1px solid #cdd9e3; border-radius: 10px;
padding: 1rem; text-align: center; margin-bottom: .8rem; }
.line { font: 600 1.15rem ui-monospace, monospace; color: #1d3557; }
.num { font: 500 .85rem ui-monospace, monospace; color: #5a7088; margin-top: .5rem;
min-height: 1.2em; transition: opacity .2s; }
.branches { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: .6rem; }
.branch { border: 1px solid #cdd9e3; border-radius: 10px; padding: .7rem; background: #fff;
opacity: .35; transition: opacity .25s; }
.branch.lit { opacity: 1; }
.bh { font: 700 .8rem system-ui; color: #1d3557; margin-bottom: .35rem; }
.bb { font-size: .85rem; color: #444; line-height: 1.4; min-height: 2.2em; }
.bb .bad { color: #c92f3c; font-weight: 600; }
.verdict { font-size: 1rem; font-weight: 700; margin: .4rem 0 .8rem; min-height: 1.4em;
text-align: center; color: #0a7d33; }
.btns { display: flex; gap: .5rem; flex-wrap: wrap; }
button { font: 600 14px system-ui, sans-serif; padding: .45rem .9rem; border: 1px solid #1d3557;
background: #1d3557; color: #fff; border-radius: 8px; cursor: pointer; }
button.ghost { background: #fff; color: #1d3557; }
button:disabled { opacity: .4; cursor: not-allowed; }
@media (max-width: 480px) { .branches { grid-template-columns: 1fr; } }
const fmt = (s, v) => s.replace(/%(\w+)%/g, (_, k) => String(v[k] ?? ''));
// Gödel’s First Incompleteness Theorem, made tangible.
//
// G is the self-referential sentence: "This statement has no proof."
// We model a SOUND system: it never proves a false statement, and never
// disproves a true one. The demo walks the two possible behaviours and shows
// that BOTH lead to contradiction unless the system simply leaves G alone —
//
// "encode" illustrates Gödel numbering: turn the symbols of G into a single
// number so the sentence can refer to itself by that number.
const SENTENCE = 'This statement has no proof.';
// A tiny, deterministic Gödel-style code: map each character to a prime base
// and combine. We only need a stable, reproducible big number for the demo.
function godelNumber(s) {
// product of prime^code is astronomically large, so we fold into a readable
// 18-digit fingerprint instead — the point is "a unique number", not its size.
let h = 1n;
const primes = [2n,3n,5n,7n,11n,13n,17n,19n,23n,29n,31n,37n];
for (let i = 0; i < s.length; i++) {
const p = primes[i % primes.length];
h = (h * p + BigInt(s.charCodeAt(i))) % 1000000000000000000n;
}
return h.toString();
}
const el = (id) => document.getElementById(id);
function reset() {
el('num').textContent = '';
el('bbProve').innerHTML = '';
el('bbRefute').innerHTML = '';
el('bProve').classList.remove('lit');
el('bRefute').classList.remove('lit');
el('verdict').textContent = '';
el('ask').disabled = true;
el('encode').disabled = false;
}
el('encode').addEventListener('click', () => {
const g = godelNumber(SENTENCE);
el('num').textContent = fmt('Gödel number of G = %g% → G now says: "the formula numbered %g% has no proof."', { g: g });
el('ask').disabled = false;
el('encode').disabled = true;
});
el('ask').addEventListener('click', () => {
el('bProve').classList.add('lit');
el('bRefute').classList.add('lit');
el('bbProve').innerHTML = '…then it proved something that claims to be unprovable. G would be <span class="bad">false</span>, but a sound system never proves falsehoods. <span class="bad">Contradiction.</span>';
el('bbRefute').innerHTML = '…then it proved “G has a proof”, i.e. G is <span class="bad">false</span>. But then there IS a proof of G, so the system both proves and disproves G. <span class="bad">Contradiction.</span>';
el('verdict').textContent = 'So a consistent system can neither prove nor disprove G — yet G is TRUE. Truth outran proof.';
el('ask').disabled = true;
});
el('reset').addEventListener('click', reset);
reset();
// Self-check logged for the curious: the Gödel number is deterministic.
console.log('G =', SENTENCE, '| Gödel number =', godelNumber(SENTENCE));
Notice the trap. If the system could prove G, then G would be false — but a sound system never proves falsehoods. So G must be true, which is exactly what G says: there is no proof of me. The truth slips through the system's fingers. Press Ask: can the system prove G? and watch both branches collapse into the same conclusion — a true sentence with no proof.
Comments
Loading comments...