Imports
/-
Copyright (c) 2026 Google LLC. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
-/
module
public import Cryptids.Semantics.Zf.Soundness
public import Cryptids.Machines
public import Mathlib.Tactic.Ring
Layer 3: 11-Register Machine & Wff-Stack Verification for zf_432_wade.tm (zf2.py)
This module formalizes the Layer 3 register-machine verification of Stefan O'Rear's ZF proof
enumerator as compiled by Andrew Wade's zf2.py (prior to commit 10fcf152b3) into the
432-state Turing machine zf_432_wade.tm:
Cantor Pairing and Unpairing (cantorStep, cantorUnpair, unpairLoop, pairLoop):
We prove the exact bijection between cantorPair and cantorUnpair (cantorPair_cantorUnpair
and cantorUnpair_cantorPair), and prove that the register-machine loops
unpair(out1, out2, in) and pair(out, in1, in2) compute cantorUnpair and cantorPair.
RPN Wff-Stack Machine and 20-Clause Sequence (WffState, weq..wa, select, cparam):
We formalize all reverse-Polish notation (RPN) stack manipulation subroutines of zf_432_wade.tm
and prove that executing v_0() followed by all 20 clauses (DET, GEN, B1, B2, B3,
B4, B6b, B8b, B6a, B6b, B6c, B7, B8a, B8b, B8c, EXT, REP, POW,
UNI, INF) with select() computes zfClauseDispatch.
Soundness and Completeness of zfMainStep (mainLoopHalts_iff_wadeZFInconsistent):
Soundness: Every formula on (topwff, wffstack) is WadeZFProvable (StackAllProvable),
preserved by every proof step regardless of prooflist; hence halting (topwff = 1) implies
WadeZFInconsistent.
Completeness: By induction on WadeZFProvable φ, every provable formula has a finite
proof-step sequence L whose execution pushes φ onto any wff-stack (topwff, wffstack).
Since nextproof enumerates all natural numbers 0, 1, 2, ... whenever prooflist drains
to 0, WadeZFInconsistent implies MainLoopHalts.
@[expose] public sectionnamespace ConjectureMachines.Semantics.Zfopen Turing StateTransitionSection 1: Cantor Pairing, Unpairing, and Register Loop Equivalence
Equivalent if-form of cantorStep matching unpair in zf_432_wade.tm.
def unpairStep (p : ℕ × ℕ) : ℕ × ℕ :=
if p.2 > 0 then (p.1 + 1, p.2 - 1) else (0, p.1 + 1)theorem unpairStep_eq_cantorStep (p : ℕ × ℕ) : unpairStep p = cantorStep p := p:ℕ × ℕ⊢ unpairStep p = cantorStep p
x:ℕ⊢ unpairStep (x, 0) = cantorStep (x, 0)x:ℕy:ℕ⊢ unpairStep (x, y + 1) = cantorStep (x, y + 1) x:ℕ⊢ unpairStep (x, 0) = cantorStep (x, 0)x:ℕy:ℕ⊢ unpairStep (x, y + 1) = cantorStep (x, y + 1) All goals completed! 🐙
Tail-recursive register loop of unpair(out1, out2, in) in zf_432_wade.tm:
decrements z to 0, applying unpairStep at each iteration.
def unpairLoop : ℕ → ℕ × ℕ → ℕ × ℕ
| 0, p => p
| z + 1, p => unpairLoop z (unpairStep p)theorem unpairLoop_cantorStep (z : ℕ) (p : ℕ × ℕ) :
unpairLoop z (cantorStep p) = cantorStep (unpairLoop z p) := z:ℕp:ℕ × ℕ⊢ unpairLoop z (cantorStep p) = cantorStep (unpairLoop z p)
induction z generalizing p with
p:ℕ × ℕ⊢ unpairLoop 0 (cantorStep p) = cantorStep (unpairLoop 0 p) All goals completed! 🐙
z:ℕih:∀ (p : ℕ × ℕ), unpairLoop z (cantorStep p) = cantorStep (unpairLoop z p)p:ℕ × ℕ⊢ unpairLoop (z + 1) (cantorStep p) = cantorStep (unpairLoop (z + 1) p)
z:ℕih:∀ (p : ℕ × ℕ), unpairLoop z (cantorStep p) = cantorStep (unpairLoop z p)p:ℕ × ℕ⊢ unpairLoop z (cantorStep (cantorStep p)) = cantorStep (unpairLoop z (cantorStep p))
All goals completed! 🐙theorem unpairLoop_zero_zero (z : ℕ) :
unpairLoop z (0, 0) = cantorUnpair z := z:ℕ⊢ unpairLoop z (0, 0) = cantorUnpair z
induction z with
⊢ unpairLoop 0 (0, 0) = cantorUnpair 0 All goals completed! 🐙
z:ℕih:unpairLoop z (0, 0) = cantorUnpair z⊢ unpairLoop (z + 1) (0, 0) = cantorUnpair (z + 1)
z:ℕih:unpairLoop z (0, 0) = cantorUnpair z⊢ unpairLoop z (cantorStep (0, 0)) = cantorUnpair (z + 1)
All goals completed! 🐙
Outer accumulation loop of pair(out, in1, in2) in zf_432_wade.tm:
for each s from x + y down to 1, adds 1 + (s - 1) to out.
def triLoop : ℕ → ℕ → ℕ
| 0, acc => acc
| s + 1, acc => triLoop s (acc + (s + 1))theorem triLoop_eq (s acc : ℕ) :
triLoop s acc = acc + s * (s + 1) / 2 := by s:ℕacc:ℕ⊢ triLoop s acc = acc + s * (s + 1) / 2
induction s generalizing acc with
| zero => zero acc:ℕ⊢ triLoop 0 acc = acc + 0 * (0 + 1) / 2 simp [triLoop] All goals completed! 🐙
| succ s ih => succ s:ℕih:∀ (acc : ℕ), triLoop s acc = acc + s * (s + 1) / 2acc:ℕ⊢ triLoop (s + 1) acc = acc + (s + 1) * (s + 1 + 1) / 2
rw [triLoop, succ s:ℕih:∀ (acc : ℕ), triLoop s acc = acc + s * (s + 1) / 2acc:ℕ⊢ triLoop s (acc + (s + 1)) = acc + (s + 1) * (s + 1 + 1) / 2 ih, succ s:ℕih:∀ (acc : ℕ), triLoop s acc = acc + s * (s + 1) / 2acc:ℕ⊢ acc + (s + 1) + s * (s + 1) / 2 = acc + (s + 1) * (s + 1 + 1) / 2 tri_succ succ s:ℕih:∀ (acc : ℕ), triLoop s acc = acc + s * (s + 1) / 2acc:ℕ⊢ acc + (s + 1) + s * (s + 1) / 2 = acc + (s * (s + 1) / 2 + (s + 1))] succ s:ℕih:∀ (acc : ℕ), triLoop s acc = acc + s * (s + 1) / 2acc:ℕ⊢ acc + (s + 1) + s * (s + 1) / 2 = acc + (s * (s + 1) / 2 + (s + 1))
omega All goals completed! 🐙
Register loop model of pair(out, in1, in2) in zf_432_wade.tm.
def pairLoop (out x y : ℕ) : ℕ :=
triLoop (x + y) (out + x)theorem pairLoop_eq_cantorPair (out x y : ℕ) :
pairLoop out x y = out + cantorPair x y := by out:ℕx:ℕy:ℕ⊢ pairLoop out x y = out + cantorPair x y
unfold pairLoop cantorPair out:ℕx:ℕy:ℕ⊢ triLoop (x + y) (out + x) = out + (x + (x + y) * (x + y + 1) / 2)
rw [triLoop_eq out:ℕx:ℕy:ℕ⊢ out + x + (x + y) * (x + y + 1) / 2 = out + (x + (x + y) * (x + y + 1) / 2)] out:ℕx:ℕy:ℕ⊢ out + x + (x + y) * (x + y + 1) / 2 = out + (x + (x + y) * (x + y + 1) / 2)
omega All goals completed! 🐙Section 2: RPN Wff-Stack Machine and 20-Clause Verification
State of the formula-construction registers
(topwff, wffstack, axiomcode, param1, param2, param3) during a single iteration of main() in
zf_432_wade.tm.
structure WffState where
topwff : ℕ
wffstack : ℕ
axiomcode : ℕ
param1 : ℕ
param2 : ℕ
param3 : ℕ
deriving DecidableEq, Repr
pushwff() in zf2.nql: pair(wffstack, topwff, wffstack) (which zeros topwff).
def rpnPushwff (s : WffState) : WffState :=
{ s with topwff := 0, wffstack := cantorPair s.topwff s.wffstack }
popwff() in zf2.nql: unpair(topwff, wffstack, wffstack).
def rpnPopwff (s : WffState) : WffState :=
let p := cantorUnpair s.wffstack
{ s with topwff := p.1, wffstack := p.2 }
v_k_() in zf2.nql: pushwff(); topwff = topwff + k.
def rpnVk (k : ℕ) (s : WffState) : WffState :=
{ s with topwff := k, wffstack := cantorPair s.topwff s.wffstack }
cons() in zf2.nql: unpair(t2, wffstack, wffstack); pair(topwff, t2, topwff).
def rpnCons (s : WffState) : WffState :=
let p := cantorUnpair s.wffstack
{ s with topwff := cantorPair p.1 s.topwff, wffstack := p.2 }
weq() in zf2.nql: cons(); v_0_(); cons().
def rpnWeq (s : WffState) : WffState :=
rpnCons (rpnVk 0 (rpnCons s))
wel() in zf2.nql: cons(); v_1_(); cons().
def rpnWel (s : WffState) : WffState :=
rpnCons (rpnVk 1 (rpnCons s))
wim() in zf2.nql: cons(); v_2_(); cons().
def rpnWim (s : WffState) : WffState :=
rpnCons (rpnVk 2 (rpnCons s))
wn() in zf2.nql: v_3_(); cons().
def rpnWn (s : WffState) : WffState :=
rpnCons (rpnVk 3 s)
wal() in zf2.nql: cons(); v_4_(); cons().
def rpnWal (s : WffState) : WffState :=
rpnCons (rpnVk 4 (rpnCons s))
wex() in zf2.nql: wn(); wal(); wn().
def rpnWex (s : WffState) : WffState :=
rpnWn (rpnWal (rpnWn s))
wa() in zf2.nql: wn(); wim(); wn().
def rpnWa (s : WffState) : WffState :=
rpnWn (rpnWim (rpnWn s))
par1() in zf2.nql: pushwff(); topwff = param1.
def rpnPar1 (s : WffState) : WffState :=
{ s with topwff := s.param1, wffstack := cantorPair s.topwff s.wffstack }
par2() in zf2.nql: pushwff(); topwff = param2.
def rpnPar2 (s : WffState) : WffState :=
{ s with topwff := s.param2, wffstack := cantorPair s.topwff s.wffstack }
par3() in zf2.nql: pushwff(); topwff = param3.
def rpnPar3 (s : WffState) : WffState :=
{ s with topwff := s.param3, wffstack := cantorPair s.topwff s.wffstack }
select() in zf2.nql:
builtin_move(t2, topwff); popwff();
if (axiomcode > 0) { axiomcode = axiomcode - 1; builtin_move(topwff, t2); }
def rpnSelect (s : WffState) : WffState :=
let t2 := s.topwff
let popped := cantorUnpair s.wffstack
if s.axiomcode > 0 then
{ s with topwff := t2, wffstack := popped.2, axiomcode := s.axiomcode - 1 }
else
{ s with topwff := popped.1, wffstack := popped.2 }
cparam(param2) in zf2.nql: if axiomcode == 1, pops from wffstack into param2.
def rpnCparam2 (s : WffState) : WffState :=
if s.axiomcode = 1 then
let p := cantorUnpair s.wffstack
{ s with wffstack := p.2, param2 := p.1 }
else s
cparam(param3) in zf2.nql: if axiomcode == 1, pops from wffstack into param3.
def rpnCparam3 (s : WffState) : WffState :=
if s.axiomcode = 1 then
let p := cantorUnpair s.wffstack
{ s with wffstack := p.2, param3 := p.1 }
else s
DET equality check on topwff and param2 in zf_432_wade.tm.
def rpnDetCheck (s : WffState) : WffState :=
{ s with topwff := if s.topwff = s.param2 then s.param1 else 0 }
First variable-distinctness check in B6a (zf_432_wade.tm), where main().n_140.1
restores scratch1 into param1 instead of param3.
def rpnB6aCheck1 (s : WffState) : WffState :=
{ s with
topwff := if s.param1 = s.param3 then 0 else s.topwff
param1 := s.param1 + s.param3
param3 := 0 }
Second variable-distinctness check in B6a (zf_432_wade.tm).
def rpnB6aCheck2 (s : WffState) : WffState :=
{ s with
topwff := if s.param2 = s.param3 then 0 else s.topwff
param1 := s.param1 + s.param3
param3 := 0 }@[simp]
theorem rpnCons_cantorPair (x y stk ac p1 p2 p3 : ℕ) :
rpnCons ⟨y, cantorPair x stk, ac, p1, p2, p3⟩ =
⟨cantorPair x y, stk, ac, p1, p2, p3⟩ := by x:ℕy:ℕstk:ℕac:ℕp1:ℕp2:ℕp3:ℕ⊢ rpnCons { topwff := y, wffstack := cantorPair x stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := cantorPair x y, wffstack := stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 }
simp [rpnCons] All goals completed! 🐙@[simp]
theorem rpnWeq_eval (x y stk ac p1 p2 p3 : ℕ) :
rpnWeq ⟨y, cantorPair x stk, ac, p1, p2, p3⟩ =
⟨zfEq x y, stk, ac, p1, p2, p3⟩ := by x:ℕy:ℕstk:ℕac:ℕp1:ℕp2:ℕp3:ℕ⊢ rpnWeq { topwff := y, wffstack := cantorPair x stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := zfEq x y, wffstack := stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 }
simp [rpnWeq, rpnVk, zfEq] All goals completed! 🐙@[simp]
theorem rpnWel_eval (x y stk ac p1 p2 p3 : ℕ) :
rpnWel ⟨y, cantorPair x stk, ac, p1, p2, p3⟩ =
⟨zfMem x y, stk, ac, p1, p2, p3⟩ := by x:ℕy:ℕstk:ℕac:ℕp1:ℕp2:ℕp3:ℕ⊢ rpnWel { topwff := y, wffstack := cantorPair x stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := zfMem x y, wffstack := stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 }
simp [rpnWel, rpnVk, zfMem] All goals completed! 🐙@[simp]
theorem rpnWim_eval (φ ψ stk ac p1 p2 p3 : ℕ) :
rpnWim ⟨ψ, cantorPair φ stk, ac, p1, p2, p3⟩ =
⟨zfImp φ ψ, stk, ac, p1, p2, p3⟩ := by φ:ℕψ:ℕstk:ℕac:ℕp1:ℕp2:ℕp3:ℕ⊢ rpnWim { topwff := ψ, wffstack := cantorPair φ stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := zfImp φ ψ, wffstack := stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 }
simp [rpnWim, rpnVk, zfImp] All goals completed! 🐙@[simp]
theorem rpnWn_eval (φ stk ac p1 p2 p3 : ℕ) :
rpnWn ⟨φ, stk, ac, p1, p2, p3⟩ =
⟨zfNot φ, stk, ac, p1, p2, p3⟩ := by φ:ℕstk:ℕac:ℕp1:ℕp2:ℕp3:ℕ⊢ rpnWn { topwff := φ, wffstack := stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := zfNot φ, wffstack := stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 }
simp [rpnWn, rpnVk, zfNot] All goals completed! 🐙@[simp]
theorem rpnWal_eval (x φ stk ac p1 p2 p3 : ℕ) :
rpnWal ⟨φ, cantorPair x stk, ac, p1, p2, p3⟩ =
⟨zfAll x φ, stk, ac, p1, p2, p3⟩ := by x:ℕφ:ℕstk:ℕac:ℕp1:ℕp2:ℕp3:ℕ⊢ rpnWal { topwff := φ, wffstack := cantorPair x stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := zfAll x φ, wffstack := stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 }
simp [rpnWal, rpnVk, zfAll] All goals completed! 🐙@[simp]
theorem rpnWex_eval (x φ stk ac p1 p2 p3 : ℕ) :
rpnWex ⟨φ, cantorPair x stk, ac, p1, p2, p3⟩ =
⟨zfEx x φ, stk, ac, p1, p2, p3⟩ := by x:ℕφ:ℕstk:ℕac:ℕp1:ℕp2:ℕp3:ℕ⊢ rpnWex { topwff := φ, wffstack := cantorPair x stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := zfEx x φ, wffstack := stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 }
simp [rpnWex, zfEx] All goals completed! 🐙@[simp]
theorem rpnWa_eval (φ ψ stk ac p1 p2 p3 : ℕ) :
rpnWa ⟨ψ, cantorPair φ stk, ac, p1, p2, p3⟩ =
⟨zfAnd φ ψ, stk, ac, p1, p2, p3⟩ := by φ:ℕψ:ℕstk:ℕac:ℕp1:ℕp2:ℕp3:ℕ⊢ rpnWa { topwff := ψ, wffstack := cantorPair φ stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := zfAnd φ ψ, wffstack := stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 }
simp [rpnWa, zfAnd] All goals completed! 🐙@[simp]
theorem rpnSelect_eval (candidate prev stk ac p1 p2 p3 : ℕ) :
rpnSelect ⟨candidate, cantorPair prev stk, ac, p1, p2, p3⟩ =
⟨if ac > 0 then candidate else prev, stk, ac - 1, p1, p2, p3⟩ := by candidate:ℕprev:ℕstk:ℕac:ℕp1:ℕp2:ℕp3:ℕ⊢ rpnSelect
{ topwff := candidate, wffstack := cantorPair prev stk, axiomcode := ac, param1 := p1, param2 := p2,
param3 := p3 } =
{ topwff := if ac > 0 then candidate else prev, wffstack := stk, axiomcode := ac - 1, param1 := p1, param2 := p2,
param3 := p3 }
cases ac zero candidate:ℕprev:ℕstk:ℕp1:ℕp2:ℕp3:ℕ⊢ rpnSelect
{ topwff := candidate, wffstack := cantorPair prev stk, axiomcode := 0, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := if 0 > 0 then candidate else prev, wffstack := stk, axiomcode := 0 - 1, param1 := p1, param2 := p2,
param3 := p3 }succ candidate:ℕprev:ℕstk:ℕp1:ℕp2:ℕp3:ℕn✝:ℕ⊢ rpnSelect
{ topwff := candidate, wffstack := cantorPair prev stk, axiomcode := n✝ + 1, param1 := p1, param2 := p2,
param3 := p3 } =
{ topwff := if n✝ + 1 > 0 then candidate else prev, wffstack := stk, axiomcode := n✝ + 1 - 1, param1 := p1,
param2 := p2, param3 := p3 } <;> zero candidate:ℕprev:ℕstk:ℕp1:ℕp2:ℕp3:ℕ⊢ rpnSelect
{ topwff := candidate, wffstack := cantorPair prev stk, axiomcode := 0, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := if 0 > 0 then candidate else prev, wffstack := stk, axiomcode := 0 - 1, param1 := p1, param2 := p2,
param3 := p3 }succ candidate:ℕprev:ℕstk:ℕp1:ℕp2:ℕp3:ℕn✝:ℕ⊢ rpnSelect
{ topwff := candidate, wffstack := cantorPair prev stk, axiomcode := n✝ + 1, param1 := p1, param2 := p2,
param3 := p3 } =
{ topwff := if n✝ + 1 > 0 then candidate else prev, wffstack := stk, axiomcode := n✝ + 1 - 1, param1 := p1,
param2 := p2, param3 := p3 } simp [rpnSelect] All goals completed! 🐙
Exact functional specification of the 20-clause dispatch executed by main() in
zf_432_wade.tm, mapping (topwff, wffstack, axiomcode, param1, param2, param3) to the new
(topwff', wffstack').
def zfClauseDispatch (topwff wffstack ac p1 p2 p3 : ℕ) : ℕ × ℕ :=
let stk0 := cantorPair topwff wffstack
match ac with
| 0 => (0, stk0)
| 1 =>
-- DET (Modus Ponens): pops minor premise φ and major premise ψ_maj from stk0
let pop1 := cantorUnpair stk0
let φ := pop1.1
let pop2 := cantorUnpair pop1.2
let maj := pop2.1
let stk2 := pop2.2
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
-- GEN (Universal Generalization): pops premise φ from stk0, pushes ∀ v_{p1} φ
let pop1 := cantorUnpair stk0
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| _ + 20 => (axInf, stk0)
RPN Clause Definitions and Equivalence with zfClauseDispatch
Clause DET in zf_432_wade.tm.
def rpnClauseDET (s : WffState) : WffState :=
rpnSelect (rpnDetCheck (rpnWim (rpnPar1 (rpnPar3 (rpnCparam2 (rpnCparam3 s))))))
Clause GEN in zf_432_wade.tm.
def rpnClauseGEN (s : WffState) : WffState :=
rpnSelect (rpnWal (rpnPar3 (rpnPar1 (rpnCparam3 s))))
Clause B1 in zf_432_wade.tm.
def rpnClauseB1 (s : WffState) : WffState :=
rpnSelect (rpnWim (rpnWim (rpnWim (rpnPar3 (rpnPar1 (rpnWim
(rpnPar3 (rpnPar2 (rpnWim (rpnPar2 (rpnPar1 s)))))))))))
Clause B2 in zf_432_wade.tm.
def rpnClauseB2 (s : WffState) : WffState :=
rpnSelect (rpnWim (rpnPar1 (rpnWim (rpnPar1 (rpnWn (rpnPar1 s))))))
Clause B3 in zf_432_wade.tm.
def rpnClauseB3 (s : WffState) : WffState :=
rpnSelect (rpnWim (rpnWim (rpnPar2 (rpnWn (rpnPar1 (rpnPar1 s))))))
Clause B4 in zf_432_wade.tm.
def rpnClauseB4 (s : WffState) : WffState :=
rpnSelect (rpnWim (rpnWim (rpnWal (rpnPar3 (rpnPar1 (rpnWal
(rpnPar2 (rpnPar1 (rpnWal (rpnWim (rpnPar3 (rpnPar2 (rpnPar1 s)))))))))))))
Clause B6a in zf_432_wade.tm.
def rpnClauseB6a (s : WffState) : WffState :=
let s1 := rpnWim (rpnWal (rpnWeq (rpnPar2 (rpnPar1 (rpnPar3 (rpnWeq (rpnPar2 (rpnPar1 s))))))))
let s2 := rpnWa (rpnWim (rpnWal (rpnWel (rpnPar2 (rpnPar1
(rpnPar3 (rpnWel (rpnPar2 (rpnPar1 s1)))))))))
rpnSelect (rpnB6aCheck2 (rpnB6aCheck1 s2))
Clause B6b in zf_432_wade.tm.
def rpnClauseB6b (s : WffState) : WffState :=
rpnSelect (rpnWim (rpnWal (rpnWal (rpnPar3 (rpnPar1 (rpnPar2
(rpnWal (rpnWal (rpnPar3 (rpnPar2 (rpnPar1 s)))))))))))
Clause B6c in zf_432_wade.tm.
def rpnClauseB6c (s : WffState) : WffState :=
rpnSelect (rpnWim (rpnPar2 (rpnWex (rpnWal (rpnPar2 (rpnPar1 (rpnPar1 s)))))))
Clause B7 in zf_432_wade.tm.
def rpnClauseB7 (s : WffState) : WffState :=
rpnSelect (rpnWex (rpnWeq (rpnPar2 (rpnPar1 (rpnPar1 s)))))
Clause B8a in zf_432_wade.tm.
def rpnClauseB8a (s : WffState) : WffState :=
rpnSelect (rpnWim (rpnWim (rpnWeq (rpnPar3 (rpnPar2 (rpnWeq
(rpnPar3 (rpnPar1 (rpnWeq (rpnPar2 (rpnPar1 s)))))))))))
Clause B8b in zf_432_wade.tm.
def rpnClauseB8b (s : WffState) : WffState :=
rpnSelect (rpnWim (rpnWim (rpnWel (rpnPar3 (rpnPar2 (rpnWel
(rpnPar3 (rpnPar1 (rpnWeq (rpnPar2 (rpnPar1 s)))))))))))
Clause B8c in zf_432_wade.tm.
def rpnClauseB8c (s : WffState) : WffState :=
rpnSelect (rpnWim (rpnWim (rpnWel (rpnPar2 (rpnPar3 (rpnWel
(rpnPar1 (rpnPar3 (rpnWeq (rpnPar2 (rpnPar1 s)))))))))))
Clause EXT in zf_432_wade.tm.
def rpnClauseEXT (s : WffState) : WffState :=
let s1 := rpnWim (rpnWel (rpnVk 1 (rpnVk 2 (rpnWel (rpnVk 0 (rpnVk 2 (rpnVk 2 s)))))))
let s2 := rpnWa (rpnWim (rpnWel (rpnVk 0 (rpnVk 2 (rpnWel (rpnVk 1 (rpnVk 2 s1)))))))
rpnSelect (rpnWim (rpnWeq (rpnVk 1 (rpnVk 0 (rpnWal s2)))))
Clause REP in zf_432_wade.tm.
def rpnClauseREP (s : WffState) : WffState :=
let s1 := rpnWal (rpnWex (rpnWal (rpnWim (rpnWeq (rpnVk 1 (rpnVk 2
(rpnWal (rpnPar1 (rpnVk 1 (rpnVk 2 (rpnVk 1 (rpnVk 3 s))))))))))))
let s2 := rpnWel (rpnVk 1 (rpnVk 2 (rpnVk 2 (rpnVk 1 s1))))
let s3 := rpnWim (rpnWex (rpnWa (rpnWal (rpnPar1 (rpnVk 1
(rpnWel (rpnVk 0 (rpnVk 3 (rpnVk 3 s2)))))))))
let s4 := rpnWex (rpnWa (rpnWal (rpnPar1 (rpnVk 1
(rpnWel (rpnVk 0 (rpnVk 3 (rpnVk 3 s3))))))))
let s5 := rpnWa (rpnWim (rpnWel (rpnVk 1 (rpnVk 2 s4))))
rpnSelect (rpnWim (rpnWex (rpnWal s5)))
Clause POW in zf_432_wade.tm.
def rpnClausePOW (s : WffState) : WffState :=
let s1 := rpnWal (rpnWim (rpnWel (rpnVk 0 (rpnVk 3 (rpnWel
(rpnVk 2 (rpnVk 3 (rpnVk 3 (rpnVk 2 (rpnVk 1 s))))))))))
rpnSelect (rpnWex (rpnWal (rpnWim (rpnWel (rpnVk 1 (rpnVk 2 s1))))))
Clause UNI in zf_432_wade.tm.
def rpnClauseUNI (s : WffState) : WffState :=
let s1 := rpnWex (rpnWa (rpnWel (rpnVk 0 (rpnVk 3 (rpnWel
(rpnVk 3 (rpnVk 2 (rpnVk 3 (rpnVk 2 (rpnVk 1 s))))))))))
rpnSelect (rpnWex (rpnWal (rpnWim (rpnWel (rpnVk 1 (rpnVk 2 s1))))))
Clause INF in zf_432_wade.tm.
def rpnClauseINF (s : WffState) : WffState :=
let s1 := rpnWel (rpnVk 1 (rpnVk 2 (rpnVk 2 (rpnWel (rpnVk 1
(rpnVk 0 (rpnVk 0 (rpnWel (rpnVk 1 (rpnVk 0 (rpnVk 1 s)))))))))))
let s2 := rpnWim (rpnWeq (rpnVk 0 (rpnVk 1 (rpnWel (rpnVk 2 (rpnVk 1 (rpnVk 1 s1)))))))
let s3 := rpnWal (rpnWa (rpnWim (rpnWel (rpnVk 2 (rpnVk 1 (rpnWeq (rpnVk 0 (rpnVk 1 s2))))))))
rpnSelect (rpnWex (rpnWa (rpnWal (rpnWim (rpnWex (rpnWa s3))))))
Full sequence of v_0() followed by all 20 RPN clauses in main() of zf_432_wade.tm.
def rpnAllClauses (topwff wffstack ac p1 p2 p3 : ℕ) : WffState :=
let s0 : WffState := rpnVk 0 ⟨topwff, wffstack, ac, p1, p2, p3⟩
rpnClauseINF (rpnClauseUNI (rpnClausePOW (rpnClauseREP (rpnClauseEXT
(rpnClauseB8c (rpnClauseB8b (rpnClauseB8a (rpnClauseB7 (rpnClauseB6c
(rpnClauseB6b (rpnClauseB6a (rpnClauseB8b (rpnClauseB6b (rpnClauseB4
(rpnClauseB3 (rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))))@[simp]
theorem rpnClauseB1_eval (top stk ac p1 p2 p3 : ℕ) :
rpnClauseB1 ⟨top, stk, ac, p1, p2, p3⟩ =
⟨if ac > 0 then axB1 p1 p2 p3 else top, stk, ac - 1, p1, p2, p3⟩ := by top:ℕstk:ℕac:ℕp1:ℕp2:ℕp3:ℕ⊢ rpnClauseB1 { topwff := top, wffstack := stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := if ac > 0 then axB1 p1 p2 p3 else top, wffstack := stk, axiomcode := ac - 1, param1 := p1, param2 := p2,
param3 := p3 }
simp [rpnClauseB1, rpnPar1, rpnPar2, rpnPar3, axB1] All goals completed! 🐙@[simp]
theorem rpnClauseB2_eval (top stk ac p1 p2 p3 : ℕ) :
rpnClauseB2 ⟨top, stk, ac, p1, p2, p3⟩ =
⟨if ac > 0 then axB2 p1 else top, stk, ac - 1, p1, p2, p3⟩ := by top:ℕstk:ℕac:ℕp1:ℕp2:ℕp3:ℕ⊢ rpnClauseB2 { topwff := top, wffstack := stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := if ac > 0 then axB2 p1 else top, wffstack := stk, axiomcode := ac - 1, param1 := p1, param2 := p2,
param3 := p3 }
simp [rpnClauseB2, rpnPar1, axB2] All goals completed! 🐙@[simp]
theorem rpnClauseB3_eval (top stk ac p1 p2 p3 : ℕ) :
rpnClauseB3 ⟨top, stk, ac, p1, p2, p3⟩ =
⟨if ac > 0 then axB3 p1 p2 else top, stk, ac - 1, p1, p2, p3⟩ := by top:ℕstk:ℕac:ℕp1:ℕp2:ℕp3:ℕ⊢ rpnClauseB3 { topwff := top, wffstack := stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := if ac > 0 then axB3 p1 p2 else top, wffstack := stk, axiomcode := ac - 1, param1 := p1, param2 := p2,
param3 := p3 }
simp [rpnClauseB3, rpnPar1, rpnPar2, axB3] All goals completed! 🐙@[simp]
theorem rpnClauseB4_eval (top stk ac p1 p2 p3 : ℕ) :
rpnClauseB4 ⟨top, stk, ac, p1, p2, p3⟩ =
⟨if ac > 0 then axB4 p1 p2 p3 else top, stk, ac - 1, p1, p2, p3⟩ := by top:ℕstk:ℕac:ℕp1:ℕp2:ℕp3:ℕ⊢ rpnClauseB4 { topwff := top, wffstack := stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := if ac > 0 then axB4 p1 p2 p3 else top, wffstack := stk, axiomcode := ac - 1, param1 := p1, param2 := p2,
param3 := p3 }
simp [rpnClauseB4, rpnPar1, rpnPar2, rpnPar3, axB4] All goals completed! 🐙@[simp]
theorem rpnClauseB6a_eval (top stk ac p1 p2 p3 : ℕ) :
rpnClauseB6a ⟨top, stk, ac, p1, p2, p3⟩ =
⟨if ac > 0 then (if p1 = p3 ∨ p2 = 0 then 0 else axB6a p1 p2 p3) else top,
stk, ac - 1, p1 + p3, p2, 0⟩ := by top:ℕstk:ℕac:ℕp1:ℕp2:ℕp3:ℕ⊢ rpnClauseB6a { topwff := top, wffstack := stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := if ac > 0 then if p1 = p3 ∨ p2 = 0 then 0 else axB6a p1 p2 p3 else top, wffstack := stk,
axiomcode := ac - 1, param1 := p1 + p3, param2 := p2, param3 := 0 }
by_cases hp1 : p1 = p3 pos top:ℕstk:ℕac:ℕp1:ℕp2:ℕp3:ℕhp1:p1 = p3⊢ rpnClauseB6a { topwff := top, wffstack := stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := if ac > 0 then if p1 = p3 ∨ p2 = 0 then 0 else axB6a p1 p2 p3 else top, wffstack := stk,
axiomcode := ac - 1, param1 := p1 + p3, param2 := p2, param3 := 0 }neg top:ℕstk:ℕac:ℕp1:ℕp2:ℕp3:ℕhp1:¬p1 = p3⊢ rpnClauseB6a { topwff := top, wffstack := stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := if ac > 0 then if p1 = p3 ∨ p2 = 0 then 0 else axB6a p1 p2 p3 else top, wffstack := stk,
axiomcode := ac - 1, param1 := p1 + p3, param2 := p2, param3 := 0 } <;> pos top:ℕstk:ℕac:ℕp1:ℕp2:ℕp3:ℕhp1:p1 = p3⊢ rpnClauseB6a { topwff := top, wffstack := stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := if ac > 0 then if p1 = p3 ∨ p2 = 0 then 0 else axB6a p1 p2 p3 else top, wffstack := stk,
axiomcode := ac - 1, param1 := p1 + p3, param2 := p2, param3 := 0 }neg top:ℕstk:ℕac:ℕp1:ℕp2:ℕp3:ℕhp1:¬p1 = p3⊢ rpnClauseB6a { topwff := top, wffstack := stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := if ac > 0 then if p1 = p3 ∨ p2 = 0 then 0 else axB6a p1 p2 p3 else top, wffstack := stk,
axiomcode := ac - 1, param1 := p1 + p3, param2 := p2, param3 := 0 } by_cases hp2 : p2 = 0 pos top:ℕstk:ℕac:ℕp1:ℕp2:ℕp3:ℕhp1:¬p1 = p3hp2:p2 = 0⊢ rpnClauseB6a { topwff := top, wffstack := stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := if ac > 0 then if p1 = p3 ∨ p2 = 0 then 0 else axB6a p1 p2 p3 else top, wffstack := stk,
axiomcode := ac - 1, param1 := p1 + p3, param2 := p2, param3 := 0 }neg top:ℕstk:ℕac:ℕp1:ℕp2:ℕp3:ℕhp1:¬p1 = p3hp2:¬p2 = 0⊢ rpnClauseB6a { topwff := top, wffstack := stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := if ac > 0 then if p1 = p3 ∨ p2 = 0 then 0 else axB6a p1 p2 p3 else top, wffstack := stk,
axiomcode := ac - 1, param1 := p1 + p3, param2 := p2, param3 := 0 } <;> pos top:ℕstk:ℕac:ℕp1:ℕp2:ℕp3:ℕhp1:p1 = p3hp2:p2 = 0⊢ rpnClauseB6a { topwff := top, wffstack := stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := if ac > 0 then if p1 = p3 ∨ p2 = 0 then 0 else axB6a p1 p2 p3 else top, wffstack := stk,
axiomcode := ac - 1, param1 := p1 + p3, param2 := p2, param3 := 0 }neg top:ℕstk:ℕac:ℕp1:ℕp2:ℕp3:ℕhp1:p1 = p3hp2:¬p2 = 0⊢ rpnClauseB6a { topwff := top, wffstack := stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := if ac > 0 then if p1 = p3 ∨ p2 = 0 then 0 else axB6a p1 p2 p3 else top, wffstack := stk,
axiomcode := ac - 1, param1 := p1 + p3, param2 := p2, param3 := 0 }pos top:ℕstk:ℕac:ℕp1:ℕp2:ℕp3:ℕhp1:¬p1 = p3hp2:p2 = 0⊢ rpnClauseB6a { topwff := top, wffstack := stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := if ac > 0 then if p1 = p3 ∨ p2 = 0 then 0 else axB6a p1 p2 p3 else top, wffstack := stk,
axiomcode := ac - 1, param1 := p1 + p3, param2 := p2, param3 := 0 }neg top:ℕstk:ℕac:ℕp1:ℕp2:ℕp3:ℕhp1:¬p1 = p3hp2:¬p2 = 0⊢ rpnClauseB6a { topwff := top, wffstack := stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := if ac > 0 then if p1 = p3 ∨ p2 = 0 then 0 else axB6a p1 p2 p3 else top, wffstack := stk,
axiomcode := ac - 1, param1 := p1 + p3, param2 := p2, param3 := 0 }
simp [rpnClauseB6a, rpnB6aCheck1, rpnB6aCheck2, rpnPar1, rpnPar2, rpnPar3, axB6a, hp1, hp2] All goals completed! 🐙@[simp]
theorem rpnClauseB6b_eval (top stk ac p1 p2 p3 : ℕ) :
rpnClauseB6b ⟨top, stk, ac, p1, p2, p3⟩ =
⟨if ac > 0 then axB6b p1 p2 p3 else top, stk, ac - 1, p1, p2, p3⟩ := by top:ℕstk:ℕac:ℕp1:ℕp2:ℕp3:ℕ⊢ rpnClauseB6b { topwff := top, wffstack := stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := if ac > 0 then axB6b p1 p2 p3 else top, wffstack := stk, axiomcode := ac - 1, param1 := p1, param2 := p2,
param3 := p3 }
simp [rpnClauseB6b, rpnPar1, rpnPar2, rpnPar3, axB6b] All goals completed! 🐙@[simp]
theorem rpnClauseB6c_eval (top stk ac p1 p2 p3 : ℕ) :
rpnClauseB6c ⟨top, stk, ac, p1, p2, p3⟩ =
⟨if ac > 0 then axB6c p1 p2 else top, stk, ac - 1, p1, p2, p3⟩ := by top:ℕstk:ℕac:ℕp1:ℕp2:ℕp3:ℕ⊢ rpnClauseB6c { topwff := top, wffstack := stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := if ac > 0 then axB6c p1 p2 else top, wffstack := stk, axiomcode := ac - 1, param1 := p1, param2 := p2,
param3 := p3 }
simp [rpnClauseB6c, rpnPar1, rpnPar2, axB6c] All goals completed! 🐙@[simp]
theorem rpnClauseB7_eval (top stk ac p1 p2 p3 : ℕ) :
rpnClauseB7 ⟨top, stk, ac, p1, p2, p3⟩ =
⟨if ac > 0 then axB7 p1 p2 else top, stk, ac - 1, p1, p2, p3⟩ := by top:ℕstk:ℕac:ℕp1:ℕp2:ℕp3:ℕ⊢ rpnClauseB7 { topwff := top, wffstack := stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := if ac > 0 then axB7 p1 p2 else top, wffstack := stk, axiomcode := ac - 1, param1 := p1, param2 := p2,
param3 := p3 }
simp [rpnClauseB7, rpnPar1, rpnPar2, axB7] All goals completed! 🐙@[simp]
theorem rpnClauseB8a_eval (top stk ac p1 p2 p3 : ℕ) :
rpnClauseB8a ⟨top, stk, ac, p1, p2, p3⟩ =
⟨if ac > 0 then axB8a p1 p2 p3 else top, stk, ac - 1, p1, p2, p3⟩ := by top:ℕstk:ℕac:ℕp1:ℕp2:ℕp3:ℕ⊢ rpnClauseB8a { topwff := top, wffstack := stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := if ac > 0 then axB8a p1 p2 p3 else top, wffstack := stk, axiomcode := ac - 1, param1 := p1, param2 := p2,
param3 := p3 }
simp [rpnClauseB8a, rpnPar1, rpnPar2, rpnPar3, axB8a] All goals completed! 🐙@[simp]
theorem rpnClauseB8b_eval (top stk ac p1 p2 p3 : ℕ) :
rpnClauseB8b ⟨top, stk, ac, p1, p2, p3⟩ =
⟨if ac > 0 then axB8b p1 p2 p3 else top, stk, ac - 1, p1, p2, p3⟩ := by top:ℕstk:ℕac:ℕp1:ℕp2:ℕp3:ℕ⊢ rpnClauseB8b { topwff := top, wffstack := stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := if ac > 0 then axB8b p1 p2 p3 else top, wffstack := stk, axiomcode := ac - 1, param1 := p1, param2 := p2,
param3 := p3 }
simp [rpnClauseB8b, rpnPar1, rpnPar2, rpnPar3, axB8b] All goals completed! 🐙@[simp]
theorem rpnClauseB8c_eval (top stk ac p1 p2 p3 : ℕ) :
rpnClauseB8c ⟨top, stk, ac, p1, p2, p3⟩ =
⟨if ac > 0 then axB8c p1 p2 p3 else top, stk, ac - 1, p1, p2, p3⟩ := by top:ℕstk:ℕac:ℕp1:ℕp2:ℕp3:ℕ⊢ rpnClauseB8c { topwff := top, wffstack := stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := if ac > 0 then axB8c p1 p2 p3 else top, wffstack := stk, axiomcode := ac - 1, param1 := p1, param2 := p2,
param3 := p3 }
simp [rpnClauseB8c, rpnPar1, rpnPar2, rpnPar3, axB8c] All goals completed! 🐙@[simp]
theorem rpnClauseEXT_eval (top stk ac p1 p2 p3 : ℕ) :
rpnClauseEXT ⟨top, stk, ac, p1, p2, p3⟩ =
⟨if ac > 0 then axExt else top, stk, ac - 1, p1, p2, p3⟩ := by top:ℕstk:ℕac:ℕp1:ℕp2:ℕp3:ℕ⊢ rpnClauseEXT { topwff := top, wffstack := stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := if ac > 0 then axExt else top, wffstack := stk, axiomcode := ac - 1, param1 := p1, param2 := p2,
param3 := p3 }
simp [rpnClauseEXT, rpnVk, axExt] All goals completed! 🐙@[simp]
theorem rpnClauseREP_eval (top stk ac p1 p2 p3 : ℕ) :
rpnClauseREP ⟨top, stk, ac, p1, p2, p3⟩ =
⟨if ac > 0 then axRep p1 else top, stk, ac - 1, p1, p2, p3⟩ := by top:ℕstk:ℕac:ℕp1:ℕp2:ℕp3:ℕ⊢ rpnClauseREP { topwff := top, wffstack := stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := if ac > 0 then axRep p1 else top, wffstack := stk, axiomcode := ac - 1, param1 := p1, param2 := p2,
param3 := p3 }
simp [rpnClauseREP, rpnVk, rpnPar1, axRep, axRepRhs] All goals completed! 🐙@[simp]
theorem rpnClausePOW_eval (top stk ac p1 p2 p3 : ℕ) :
rpnClausePOW ⟨top, stk, ac, p1, p2, p3⟩ =
⟨if ac > 0 then axPow else top, stk, ac - 1, p1, p2, p3⟩ := by top:ℕstk:ℕac:ℕp1:ℕp2:ℕp3:ℕ⊢ rpnClausePOW { topwff := top, wffstack := stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := if ac > 0 then axPow else top, wffstack := stk, axiomcode := ac - 1, param1 := p1, param2 := p2,
param3 := p3 }
simp [rpnClausePOW, rpnVk, axPow] All goals completed! 🐙@[simp]
theorem rpnClauseUNI_eval (top stk ac p1 p2 p3 : ℕ) :
rpnClauseUNI ⟨top, stk, ac, p1, p2, p3⟩ =
⟨if ac > 0 then axUni else top, stk, ac - 1, p1, p2, p3⟩ := by top:ℕstk:ℕac:ℕp1:ℕp2:ℕp3:ℕ⊢ rpnClauseUNI { topwff := top, wffstack := stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := if ac > 0 then axUni else top, wffstack := stk, axiomcode := ac - 1, param1 := p1, param2 := p2,
param3 := p3 }
simp [rpnClauseUNI, rpnVk, axUni] All goals completed! 🐙@[simp]
theorem rpnClauseINF_eval (top stk ac p1 p2 p3 : ℕ) :
rpnClauseINF ⟨top, stk, ac, p1, p2, p3⟩ =
⟨if ac > 0 then axInf else top, stk, ac - 1, p1, p2, p3⟩ := by top:ℕstk:ℕac:ℕp1:ℕp2:ℕp3:ℕ⊢ rpnClauseINF { topwff := top, wffstack := stk, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 } =
{ topwff := if ac > 0 then axInf else top, wffstack := stk, axiomcode := ac - 1, param1 := p1, param2 := p2,
param3 := p3 }
simp [rpnClauseINF, rpnVk, axInf, axInfSingleton] All goals completed! 🐙
Complete equivalence between the 20-clause RPN execution rpnAllClauses and the
functional specification zfClauseDispatch.
theorem rpnAllClauses_eq_zfClauseDispatch (topwff wffstack ac p1 p2 p3 : ℕ) :
let out := rpnAllClauses topwff wffstack ac p1 p2 p3
(out.topwff, out.wffstack) = zfClauseDispatch topwff wffstack ac p1 p2 p3 := by topwff:ℕwffstack:ℕac:ℕp1:ℕp2:ℕp3:ℕ⊢ let out := rpnAllClauses topwff wffstack ac p1 p2 p3;
(out.topwff, out.wffstack) = zfClauseDispatch topwff wffstack ac p1 p2 p3
unfold rpnAllClauses zfClauseDispatch topwff:ℕwffstack:ℕac:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0 { topwff := topwff, wffstack := wffstack, axiomcode := ac, param1 := p1, param2 := p2, param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match ac with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0)
rcases ac with _ | _ | _ | _ | _ | _ | _ | _ | _ | _ | _ | _ | _ | _ | _ | _ | _ | _ | _ | _ | ac zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0 { topwff := topwff, wffstack := wffstack, axiomcode := 0, param1 := p1, param2 := p2, param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0)succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0 { topwff := topwff, wffstack := wffstack, axiomcode := 0 + 1, param1 := p1, param2 := p2, param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0)succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack, axiomcode := 0 + 1 + 1, param1 := p1, param2 := p2, param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0)succ.succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack, axiomcode := 0 + 1 + 1 + 1, param1 := p1, param2 := p2, param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0)succ.succ.succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack, axiomcode := 0 + 1 + 1 + 1 + 1, param1 := p1, param2 := p2,
param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0)succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack, axiomcode := 0 + 1 + 1 + 1 + 1 + 1, param1 := p1, param2 := p2,
param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0)succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack, axiomcode := 0 + 1 + 1 + 1 + 1 + 1 + 1, param1 := p1, param2 := p2,
param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 + 1 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0)succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack, axiomcode := 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1, param1 := p1, param2 := p2,
param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0)succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack, axiomcode := 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1, param1 := p1,
param2 := p2, param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0)succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack, axiomcode := 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1, param1 := p1,
param2 := p2, param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0)succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack, axiomcode := 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1, param1 := p1,
param2 := p2, param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0)succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack, axiomcode := 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1,
param1 := p1, param2 := p2, param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0)succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack, axiomcode := 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1,
param1 := p1, param2 := p2, param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0)succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack, axiomcode := 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1,
param1 := p1, param2 := p2, param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0)succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack, axiomcode := 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1,
param1 := p1, param2 := p2, param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0)succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack,
axiomcode := 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1, param1 := p1, param2 := p2,
param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0)succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack,
axiomcode := 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1, param1 := p1, param2 := p2,
param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0)succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack,
axiomcode := 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1, param1 := p1, param2 := p2,
param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0)succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack,
axiomcode := 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1, param1 := p1,
param2 := p2, param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0)succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack,
axiomcode := 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1, param1 := p1,
param2 := p2, param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0)succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕac:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack,
axiomcode := ac + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1, param1 := p1,
param2 := p2, param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match ac + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0)
· zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0 { topwff := topwff, wffstack := wffstack, axiomcode := 0, param1 := p1, param2 := p2, param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0) simp [rpnVk, rpnClauseDET, rpnDetCheck, rpnClauseGEN, rpnCparam2, rpnCparam3, rpnPar1, rpnPar3] All goals completed! 🐙
· succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0 { topwff := topwff, wffstack := wffstack, axiomcode := 0 + 1, param1 := p1, param2 := p2, param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0) simp [rpnVk, rpnClauseDET, rpnDetCheck, rpnClauseGEN, rpnCparam2, rpnCparam3, rpnPar1, rpnPar3] succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ (if zfImp topwff p1 = (cantorUnpair wffstack).1 then p1 else 0, (cantorUnpair wffstack).2) =
if zfImp topwff p1 = (cantorUnpair wffstack).1 then (p1, (cantorUnpair wffstack).2)
else (0, (cantorUnpair wffstack).2)
split_ifs pos topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕh✝:zfImp topwff p1 = (cantorUnpair wffstack).1⊢ (p1, (cantorUnpair wffstack).2) = (p1, (cantorUnpair wffstack).2)neg topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕh✝:¬zfImp topwff p1 = (cantorUnpair wffstack).1⊢ (0, (cantorUnpair wffstack).2) = (0, (cantorUnpair wffstack).2) <;> pos topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕh✝:zfImp topwff p1 = (cantorUnpair wffstack).1⊢ (p1, (cantorUnpair wffstack).2) = (p1, (cantorUnpair wffstack).2)neg topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕh✝:¬zfImp topwff p1 = (cantorUnpair wffstack).1⊢ (0, (cantorUnpair wffstack).2) = (0, (cantorUnpair wffstack).2) rfl All goals completed! 🐙
· succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack, axiomcode := 0 + 1 + 1, param1 := p1, param2 := p2, param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0) simp [rpnVk, rpnClauseDET, rpnDetCheck, rpnClauseGEN, rpnCparam2, rpnCparam3, rpnPar1, rpnPar3] All goals completed! 🐙
· succ.succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack, axiomcode := 0 + 1 + 1 + 1, param1 := p1, param2 := p2, param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0) simp [rpnVk, rpnClauseDET, rpnDetCheck, rpnClauseGEN, rpnCparam2, rpnCparam3, rpnPar1, rpnPar3] All goals completed! 🐙
· succ.succ.succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack, axiomcode := 0 + 1 + 1 + 1 + 1, param1 := p1, param2 := p2,
param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0) simp [rpnVk, rpnClauseDET, rpnDetCheck, rpnClauseGEN, rpnCparam2, rpnCparam3, rpnPar1, rpnPar3] All goals completed! 🐙
· succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack, axiomcode := 0 + 1 + 1 + 1 + 1 + 1, param1 := p1, param2 := p2,
param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0) simp [rpnVk, rpnClauseDET, rpnDetCheck, rpnClauseGEN, rpnCparam2, rpnCparam3, rpnPar1, rpnPar3] All goals completed! 🐙
· succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack, axiomcode := 0 + 1 + 1 + 1 + 1 + 1 + 1, param1 := p1, param2 := p2,
param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 + 1 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0) simp [rpnVk, rpnClauseDET, rpnDetCheck, rpnClauseGEN, rpnCparam2, rpnCparam3, rpnPar1, rpnPar3] All goals completed! 🐙
· succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack, axiomcode := 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1, param1 := p1, param2 := p2,
param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0) simp [rpnVk, rpnClauseDET, rpnDetCheck, rpnClauseGEN, rpnCparam2, rpnCparam3, rpnPar1, rpnPar3] All goals completed! 🐙
· succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack, axiomcode := 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1, param1 := p1,
param2 := p2, param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0) simp [rpnVk, rpnClauseDET, rpnDetCheck, rpnClauseGEN, rpnCparam2, rpnCparam3, rpnPar1, rpnPar3] All goals completed! 🐙
· succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack, axiomcode := 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1, param1 := p1,
param2 := p2, param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0) simp [rpnVk, rpnClauseDET, rpnDetCheck, rpnClauseGEN, rpnCparam2, rpnCparam3, rpnPar1, rpnPar3] succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ (if p1 = p3 ∨ p2 = 0 then 0 else axB6a p1 p2 p3, cantorPair topwff wffstack) =
if p1 = p3 ∨ p2 = 0 then (0, cantorPair topwff wffstack) else (axB6a p1 p2 p3, cantorPair topwff wffstack)
split_ifs pos topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕh✝:p1 = p3 ∨ p2 = 0⊢ (0, cantorPair topwff wffstack) = (0, cantorPair topwff wffstack)neg topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕh✝:¬(p1 = p3 ∨ p2 = 0)⊢ (axB6a p1 p2 p3, cantorPair topwff wffstack) = (axB6a p1 p2 p3, cantorPair topwff wffstack) <;> pos topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕh✝:p1 = p3 ∨ p2 = 0⊢ (0, cantorPair topwff wffstack) = (0, cantorPair topwff wffstack)neg topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕh✝:¬(p1 = p3 ∨ p2 = 0)⊢ (axB6a p1 p2 p3, cantorPair topwff wffstack) = (axB6a p1 p2 p3, cantorPair topwff wffstack) rfl All goals completed! 🐙
· succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack, axiomcode := 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1, param1 := p1,
param2 := p2, param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0) simp [rpnVk, rpnClauseDET, rpnDetCheck, rpnClauseGEN, rpnCparam2, rpnCparam3, rpnPar1, rpnPar3] All goals completed! 🐙
· succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack, axiomcode := 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1,
param1 := p1, param2 := p2, param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0) simp [rpnVk, rpnClauseDET, rpnDetCheck, rpnClauseGEN, rpnCparam2, rpnCparam3, rpnPar1, rpnPar3] All goals completed! 🐙
· succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack, axiomcode := 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1,
param1 := p1, param2 := p2, param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0) simp [rpnVk, rpnClauseDET, rpnDetCheck, rpnClauseGEN, rpnCparam2, rpnCparam3, rpnPar1, rpnPar3] All goals completed! 🐙
· succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack, axiomcode := 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1,
param1 := p1, param2 := p2, param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0) simp [rpnVk, rpnClauseDET, rpnDetCheck, rpnClauseGEN, rpnCparam2, rpnCparam3, rpnPar1, rpnPar3] All goals completed! 🐙
· succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack, axiomcode := 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1,
param1 := p1, param2 := p2, param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0) simp [rpnVk, rpnClauseDET, rpnDetCheck, rpnClauseGEN, rpnCparam2, rpnCparam3, rpnPar1, rpnPar3] All goals completed! 🐙
· succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack,
axiomcode := 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1, param1 := p1, param2 := p2,
param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0) simp [rpnVk, rpnClauseDET, rpnDetCheck, rpnClauseGEN, rpnCparam2, rpnCparam3, rpnPar1, rpnPar3] All goals completed! 🐙
· succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack,
axiomcode := 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1, param1 := p1, param2 := p2,
param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0) simp [rpnVk, rpnClauseDET, rpnDetCheck, rpnClauseGEN, rpnCparam2, rpnCparam3, rpnPar1, rpnPar3] All goals completed! 🐙
· succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack,
axiomcode := 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1, param1 := p1, param2 := p2,
param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0) simp [rpnVk, rpnClauseDET, rpnDetCheck, rpnClauseGEN, rpnCparam2, rpnCparam3, rpnPar1, rpnPar3] All goals completed! 🐙
· succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack,
axiomcode := 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1, param1 := p1,
param2 := p2, param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0) simp [rpnVk, rpnClauseDET, rpnDetCheck, rpnClauseGEN, rpnCparam2, rpnCparam3, rpnPar1, rpnPar3] All goals completed! 🐙
· succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack,
axiomcode := 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1, param1 := p1,
param2 := p2, param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0) simp [rpnVk, rpnClauseDET, rpnDetCheck, rpnClauseGEN, rpnCparam2, rpnCparam3, rpnPar1, rpnPar3] All goals completed! 🐙
· succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ topwff:ℕwffstack:ℕp1:ℕp2:ℕp3:ℕac:ℕ⊢ let out :=
have s0 :=
rpnVk 0
{ topwff := topwff, wffstack := wffstack,
axiomcode := ac + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1, param1 := p1,
param2 := p2, param3 := p3 };
rpnClauseINF
(rpnClauseUNI
(rpnClausePOW
(rpnClauseREP
(rpnClauseEXT
(rpnClauseB8c
(rpnClauseB8b
(rpnClauseB8a
(rpnClauseB7
(rpnClauseB6c
(rpnClauseB6b
(rpnClauseB6a
(rpnClauseB8b
(rpnClauseB6b
(rpnClauseB4
(rpnClauseB3
(rpnClauseB2 (rpnClauseB1 (rpnClauseGEN (rpnClauseDET s0)))))))))))))))))));
(out.topwff, out.wffstack) =
have stk0 := cantorPair topwff wffstack;
match ac + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 with
| 0 => (0, stk0)
| 1 =>
have pop1 := cantorUnpair stk0;
have φ := pop1.1;
have pop2 := cantorUnpair pop1.2;
have maj := pop2.1;
have stk2 := pop2.2;
if zfImp φ p1 = maj then (p1, stk2) else (0, stk2)
| 2 =>
have pop1 := cantorUnpair stk0;
(zfAll p1 pop1.1, pop1.2)
| 3 => (axB1 p1 p2 p3, stk0)
| 4 => (axB2 p1, stk0)
| 5 => (axB3 p1 p2, stk0)
| 6 => (axB4 p1 p2 p3, stk0)
| 7 => (axB6b p1 p2 p3, stk0)
| 8 => (axB8b p1 p2 p3, stk0)
| 9 => if p1 = p3 ∨ p2 = 0 then (0, stk0) else (axB6a p1 p2 p3, stk0)
| 10 => (axB6b (p1 + p3) p2 0, stk0)
| 11 => (axB6c (p1 + p3) p2, stk0)
| 12 => (axB7 (p1 + p3) p2, stk0)
| 13 => (axB8a (p1 + p3) p2 0, stk0)
| 14 => (axB8b (p1 + p3) p2 0, stk0)
| 15 => (axB8c (p1 + p3) p2 0, stk0)
| 16 => (axExt, stk0)
| 17 => (axRep (p1 + p3), stk0)
| 18 => (axPow, stk0)
| 19 => (axUni, stk0)
| n.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ =>
(axInf, stk0) simp [rpnVk, rpnClauseDET, rpnDetCheck, rpnClauseGEN, rpnCparam2, rpnCparam3, rpnPar1, rpnPar3] All goals completed! 🐙
Section 3: Main Loop Step (ZfMainCfg, zfMainStep, MainLoopHalts)
Persistent state of the outer loop main() in zf_432_wade.tm.
structure ZfMainCfg where
prooflist : ℕ
nextproof : ℕ
topwff : ℕ
wffstack : ℕ
deriving DecidableEq, Repr
Initial state of main() with all persistent registers zeroed.
def zfMainInit : ZfMainCfg := ⟨0, 0, 0, 0⟩
Unconditional next state of one iteration of main() (before the halt check
topwff == 1), following the compiled machine zf_432_wade.tm exactly: the loop head is
if_not_decnz(prooflist), i.e. if prooflist ≠ 0 it is decremented, otherwise it is reloaded
from nextproof (which is then incremented) without a subsequent decrement.
def zfMainNext (c : ZfMainCfg) : ZfMainCfg :=
let prooflist₁ := if c.prooflist = 0 then c.nextproof else c.prooflist - 1
let nextproof' := if c.prooflist = 0 then c.nextproof + 1 else c.nextproof
let u1 := cantorUnpair prooflist₁
let ac := u1.1
let u2 := cantorUnpair u1.2
let p1 := u2.1
let u3 := cantorUnpair u2.2
let p2 := u3.1
let u4 := cantorUnpair u3.2
let p3 := u4.1
let prooflist' := u4.2
let res := zfClauseDispatch c.topwff c.wffstack ac p1 p2 p3
⟨prooflist', nextproof', res.1, res.2⟩
One full iteration of main() in zf_432_wade.tm: updates the state via zfMainNext and halts
(none) if topwff' = 1 (zfMem 0 0).
def zfMainStep (c : ZfMainCfg) : Option ZfMainCfg :=
if (zfMainNext c).topwff = 1 then none else some (zfMainNext c)
n-step execution of zfMainStep.
def zfMainNSteps : ℕ → ZfMainCfg → Option ZfMainCfg
| 0, c => some c
| n + 1, c => (zfMainStep c).bind (zfMainNSteps n)@[simp]
theorem zfMainNSteps_zero (c : ZfMainCfg) : zfMainNSteps 0 c = some c := rfl@[simp]
theorem zfMainNSteps_succ (n : ℕ) (c : ZfMainCfg) :
zfMainNSteps (n + 1) c = (zfMainStep c).bind (zfMainNSteps n) := rfltheorem zfMainNSteps_add (m n : ℕ) (c : ZfMainCfg) :
zfMainNSteps (m + n) c = (zfMainNSteps m c).bind (zfMainNSteps n) := by m:ℕn:ℕc:ZfMainCfg⊢ zfMainNSteps (m + n) c = (zfMainNSteps m c).bind (zfMainNSteps n)
induction m generalizing c with
| zero => zero n:ℕc:ZfMainCfg⊢ zfMainNSteps (0 + n) c = (zfMainNSteps 0 c).bind (zfMainNSteps n) simp All goals completed! 🐙
| succ m ih => succ n:ℕm:ℕih:∀ (c : ZfMainCfg), zfMainNSteps (m + n) c = (zfMainNSteps m c).bind (zfMainNSteps n)c:ZfMainCfg⊢ zfMainNSteps (m + 1 + n) c = (zfMainNSteps (m + 1) c).bind (zfMainNSteps n)
rw [Nat.succ_add, succ n:ℕm:ℕih:∀ (c : ZfMainCfg), zfMainNSteps (m + n) c = (zfMainNSteps m c).bind (zfMainNSteps n)c:ZfMainCfg⊢ zfMainNSteps (m + n).succ c = (zfMainNSteps (m + 1) c).bind (zfMainNSteps n) zfMainNSteps_succ, succ n:ℕm:ℕih:∀ (c : ZfMainCfg), zfMainNSteps (m + n) c = (zfMainNSteps m c).bind (zfMainNSteps n)c:ZfMainCfg⊢ (zfMainStep c).bind (zfMainNSteps (m + n)) = (zfMainNSteps (m + 1) c).bind (zfMainNSteps n) zfMainNSteps_succ succ n:ℕm:ℕih:∀ (c : ZfMainCfg), zfMainNSteps (m + n) c = (zfMainNSteps m c).bind (zfMainNSteps n)c:ZfMainCfg⊢ (zfMainStep c).bind (zfMainNSteps (m + n)) = ((zfMainStep c).bind (zfMainNSteps m)).bind (zfMainNSteps n)] succ n:ℕm:ℕih:∀ (c : ZfMainCfg), zfMainNSteps (m + n) c = (zfMainNSteps m c).bind (zfMainNSteps n)c:ZfMainCfg⊢ (zfMainStep c).bind (zfMainNSteps (m + n)) = ((zfMainStep c).bind (zfMainNSteps m)).bind (zfMainNSteps n)
cases zfMainStep c with
| none => succ.none n:ℕm:ℕih:∀ (c : ZfMainCfg), zfMainNSteps (m + n) c = (zfMainNSteps m c).bind (zfMainNSteps n)c:ZfMainCfg⊢ none.bind (zfMainNSteps (m + n)) = (none.bind (zfMainNSteps m)).bind (zfMainNSteps n) rfl All goals completed! 🐙
| some c' => succ.some n:ℕm:ℕih:∀ (c : ZfMainCfg), zfMainNSteps (m + n) c = (zfMainNSteps m c).bind (zfMainNSteps n)c:ZfMainCfgc':ZfMainCfg⊢ (some c').bind (zfMainNSteps (m + n)) = ((some c').bind (zfMainNSteps m)).bind (zfMainNSteps n) exact ih c' All goals completed! 🐙theorem zfMainNSteps_bind_eq {m n : ℕ} {c₁ c₂ c₃ : ZfMainCfg}
(h₁ : zfMainNSteps m c₁ = some c₂) (h₂ : zfMainNSteps n c₂ = some c₃) :
zfMainNSteps (m + n) c₁ = some c₃ := by m:ℕn:ℕc₁:ZfMainCfgc₂:ZfMainCfgc₃:ZfMainCfgh₁:zfMainNSteps m c₁ = some c₂h₂:zfMainNSteps n c₂ = some c₃⊢ zfMainNSteps (m + n) c₁ = some c₃
rw [zfMainNSteps_add, m:ℕn:ℕc₁:ZfMainCfgc₂:ZfMainCfgc₃:ZfMainCfgh₁:zfMainNSteps m c₁ = some c₂h₂:zfMainNSteps n c₂ = some c₃⊢ (zfMainNSteps m c₁).bind (zfMainNSteps n) = some c₃ h₁, m:ℕn:ℕc₁:ZfMainCfgc₂:ZfMainCfgc₃:ZfMainCfgh₁:zfMainNSteps m c₁ = some c₂h₂:zfMainNSteps n c₂ = some c₃⊢ (some c₂).bind (zfMainNSteps n) = some c₃ Option.bind_some, m:ℕn:ℕc₁:ZfMainCfgc₂:ZfMainCfgc₃:ZfMainCfgh₁:zfMainNSteps m c₁ = some c₂h₂:zfMainNSteps n c₂ = some c₃⊢ zfMainNSteps n c₂ = some c₃ h₂ m:ℕn:ℕc₁:ZfMainCfgc₂:ZfMainCfgc₃:ZfMainCfgh₁:zfMainNSteps m c₁ = some c₂h₂:zfMainNSteps n c₂ = some c₃⊢ some c₃ = some c₃] All goals completed! 🐙
The main loop of zf_432_wade.tm halts starting from zfMainInit.
def MainLoopHalts : Prop :=
(eval zfMainStep zfMainInit).Domtheorem mem_eval_zfMainStep_iff_zfMainNSteps {c₀ ch : ZfMainCfg} :
ch ∈ eval zfMainStep c₀ ↔ ∃ n, zfMainNSteps n c₀ = some ch ∧ zfMainStep ch = none := by c₀:ZfMainCfgch:ZfMainCfg⊢ ch ∈ eval zfMainStep c₀ ↔ ∃ n, zfMainNSteps n c₀ = some ch ∧ zfMainStep ch = none
constructor mp c₀:ZfMainCfgch:ZfMainCfg⊢ ch ∈ eval zfMainStep c₀ → ∃ n, zfMainNSteps n c₀ = some ch ∧ zfMainStep ch = nonempr c₀:ZfMainCfgch:ZfMainCfg⊢ (∃ n, zfMainNSteps n c₀ = some ch ∧ zfMainStep ch = none) → ch ∈ eval zfMainStep c₀
· mp c₀:ZfMainCfgch:ZfMainCfg⊢ ch ∈ eval zfMainStep c₀ → ∃ n, zfMainNSteps n c₀ = some ch ∧ zfMainStep ch = none intro h mp c₀:ZfMainCfgch:ZfMainCfgh:ch ∈ eval zfMainStep c₀⊢ ∃ n, zfMainNSteps n c₀ = some ch ∧ zfMainStep ch = none
refine StateTransition.evalInduction h fun a ha ih => ?_ mp c₀:ZfMainCfgch:ZfMainCfgh:ch ∈ eval zfMainStep c₀a:ZfMainCfgha:ch ∈ eval zfMainStep aih:∀ (a' : ZfMainCfg), zfMainStep a = some a' → ∃ n, zfMainNSteps n a' = some ch ∧ zfMainStep ch = none⊢ ∃ n, zfMainNSteps n a = some ch ∧ zfMainStep ch = none
rcases hs : zfMainStep a with _ | a' mp.none c₀:ZfMainCfgch:ZfMainCfgh:ch ∈ eval zfMainStep c₀a:ZfMainCfgha:ch ∈ eval zfMainStep aih:∀ (a' : ZfMainCfg), zfMainStep a = some a' → ∃ n, zfMainNSteps n a' = some ch ∧ zfMainStep ch = nonehs:zfMainStep a = none⊢ ∃ n, zfMainNSteps n a = some ch ∧ zfMainStep ch = nonemp.some c₀:ZfMainCfgch:ZfMainCfgh:ch ∈ eval zfMainStep c₀a:ZfMainCfgha:ch ∈ eval zfMainStep aih:∀ (a' : ZfMainCfg), zfMainStep a = some a' → ∃ n, zfMainNSteps n a' = some ch ∧ zfMainStep ch = nonea':ZfMainCfghs:zfMainStep a = some a'⊢ ∃ n, zfMainNSteps n a = some ch ∧ zfMainStep ch = none
· mp.none c₀:ZfMainCfgch:ZfMainCfgh:ch ∈ eval zfMainStep c₀a:ZfMainCfgha:ch ∈ eval zfMainStep aih:∀ (a' : ZfMainCfg), zfMainStep a = some a' → ∃ n, zfMainNSteps n a' = some ch ∧ zfMainStep ch = nonehs:zfMainStep a = none⊢ ∃ n, zfMainNSteps n a = some ch ∧ zfMainStep ch = none have hmem : a ∈ eval zfMainStep a :=
StateTransition.mem_eval.mpr ⟨Relation.ReflTransGen.refl, hs⟩ mp.none c₀:ZfMainCfgch:ZfMainCfgh:ch ∈ eval zfMainStep c₀a:ZfMainCfgha:ch ∈ eval zfMainStep aih:∀ (a' : ZfMainCfg), zfMainStep a = some a' → ∃ n, zfMainNSteps n a' = some ch ∧ zfMainStep ch = nonehs:zfMainStep a = nonehmem:a ∈ eval zfMainStep a⊢ ∃ n, zfMainNSteps n a = some ch ∧ zfMainStep ch = none
have heq : ch = a := Part.mem_unique ha hmem mp.none c₀:ZfMainCfgch:ZfMainCfgh:ch ∈ eval zfMainStep c₀a:ZfMainCfgha:ch ∈ eval zfMainStep aih:∀ (a' : ZfMainCfg), zfMainStep a = some a' → ∃ n, zfMainNSteps n a' = some ch ∧ zfMainStep ch = nonehs:zfMainStep a = nonehmem:a ∈ eval zfMainStep aheq:ch = a⊢ ∃ n, zfMainNSteps n a = some ch ∧ zfMainStep ch = none
subst heq mp.none c₀:ZfMainCfgch:ZfMainCfgh:ch ∈ eval zfMainStep c₀ha:ch ∈ eval zfMainStep chih:∀ (a' : ZfMainCfg), zfMainStep ch = some a' → ∃ n, zfMainNSteps n a' = some ch ∧ zfMainStep ch = nonehs:zfMainStep ch = nonehmem:ch ∈ eval zfMainStep ch⊢ ∃ n, zfMainNSteps n ch = some ch ∧ zfMainStep ch = none
exact ⟨0, rfl, hs⟩ All goals completed! 🐙
· mp.some c₀:ZfMainCfgch:ZfMainCfgh:ch ∈ eval zfMainStep c₀a:ZfMainCfgha:ch ∈ eval zfMainStep aih:∀ (a' : ZfMainCfg), zfMainStep a = some a' → ∃ n, zfMainNSteps n a' = some ch ∧ zfMainStep ch = nonea':ZfMainCfghs:zfMainStep a = some a'⊢ ∃ n, zfMainNSteps n a = some ch ∧ zfMainStep ch = none obtain ⟨n, hn, hnone⟩ := ih a' hs mp.some c₀:ZfMainCfgch:ZfMainCfgh:ch ∈ eval zfMainStep c₀a:ZfMainCfgha:ch ∈ eval zfMainStep aih:∀ (a' : ZfMainCfg), zfMainStep a = some a' → ∃ n, zfMainNSteps n a' = some ch ∧ zfMainStep ch = nonea':ZfMainCfghs:zfMainStep a = some a'n:ℕhn:zfMainNSteps n a' = some chhnone:zfMainStep ch = none⊢ ∃ n, zfMainNSteps n a = some ch ∧ zfMainStep ch = none
exact ⟨n + 1, by c₀:ZfMainCfgch:ZfMainCfgh:ch ∈ eval zfMainStep c₀a:ZfMainCfgha:ch ∈ eval zfMainStep aih:∀ (a' : ZfMainCfg), zfMainStep a = some a' → ∃ n, zfMainNSteps n a' = some ch ∧ zfMainStep ch = nonea':ZfMainCfghs:zfMainStep a = some a'n:ℕhn:zfMainNSteps n a' = some chhnone:zfMainStep ch = none⊢ zfMainNSteps (n + 1) a = some ch simp [zfMainNSteps, hs, hn] All goals completed! 🐙, hnone⟩
· mpr c₀:ZfMainCfgch:ZfMainCfg⊢ (∃ n, zfMainNSteps n c₀ = some ch ∧ zfMainStep ch = none) → ch ∈ eval zfMainStep c₀ rintro ⟨n, hn, hnone⟩ mpr c₀:ZfMainCfgch:ZfMainCfgn:ℕhn:zfMainNSteps n c₀ = some chhnone:zfMainStep ch = none⊢ ch ∈ eval zfMainStep c₀
have hreach : Reaches zfMainStep c₀ ch := by c₀:ZfMainCfgch:ZfMainCfg⊢ ch ∈ eval zfMainStep c₀ ↔ ∃ n, zfMainNSteps n c₀ = some ch ∧ zfMainStep ch = none
induction n generalizing c₀ with
| zero => zero ch:ZfMainCfghnone:zfMainStep ch = nonec₀:ZfMainCfghn:zfMainNSteps 0 c₀ = some ch⊢ Reaches zfMainStep c₀ ch
injection hn with h' zero ch:ZfMainCfghnone:zfMainStep ch = nonec₀:ZfMainCfgh':c₀ = ch⊢ Reaches zfMainStep c₀ ch
subst h' zero c₀:ZfMainCfghnone:zfMainStep c₀ = none⊢ Reaches zfMainStep c₀ c₀
exact Relation.ReflTransGen.refl All goals completed! 🐙
| succ n ih => succ ch:ZfMainCfghnone:zfMainStep ch = nonen:ℕih:∀ {c₀ : ZfMainCfg}, zfMainNSteps n c₀ = some ch → Reaches zfMainStep c₀ chc₀:ZfMainCfghn:zfMainNSteps (n + 1) c₀ = some ch⊢ Reaches zfMainStep c₀ ch
unfold zfMainNSteps at hn succ ch:ZfMainCfghnone:zfMainStep ch = nonen:ℕih:∀ {c₀ : ZfMainCfg}, zfMainNSteps n c₀ = some ch → Reaches zfMainStep c₀ chc₀:ZfMainCfghn:(zfMainStep c₀).bind (zfMainNSteps n) = some ch⊢ Reaches zfMainStep c₀ ch
rcases hs : zfMainStep c₀ with _ | c' succ.none ch:ZfMainCfghnone:zfMainStep ch = nonen:ℕih:∀ {c₀ : ZfMainCfg}, zfMainNSteps n c₀ = some ch → Reaches zfMainStep c₀ chc₀:ZfMainCfghn:(zfMainStep c₀).bind (zfMainNSteps n) = some chhs:zfMainStep c₀ = none⊢ Reaches zfMainStep c₀ chsucc.some ch:ZfMainCfghnone:zfMainStep ch = nonen:ℕih:∀ {c₀ : ZfMainCfg}, zfMainNSteps n c₀ = some ch → Reaches zfMainStep c₀ chc₀:ZfMainCfghn:(zfMainStep c₀).bind (zfMainNSteps n) = some chc':ZfMainCfghs:zfMainStep c₀ = some c'⊢ Reaches zfMainStep c₀ ch
· succ.none ch:ZfMainCfghnone:zfMainStep ch = nonen:ℕih:∀ {c₀ : ZfMainCfg}, zfMainNSteps n c₀ = some ch → Reaches zfMainStep c₀ chc₀:ZfMainCfghn:(zfMainStep c₀).bind (zfMainNSteps n) = some chhs:zfMainStep c₀ = none⊢ Reaches zfMainStep c₀ ch rw [hs succ.none ch:ZfMainCfghnone:zfMainStep ch = nonen:ℕih:∀ {c₀ : ZfMainCfg}, zfMainNSteps n c₀ = some ch → Reaches zfMainStep c₀ chc₀:ZfMainCfghn:none.bind (zfMainNSteps n) = some chhs:zfMainStep c₀ = none⊢ Reaches zfMainStep c₀ ch] at hn succ.none ch:ZfMainCfghnone:zfMainStep ch = nonen:ℕih:∀ {c₀ : ZfMainCfg}, zfMainNSteps n c₀ = some ch → Reaches zfMainStep c₀ chc₀:ZfMainCfghn:none.bind (zfMainNSteps n) = some chhs:zfMainStep c₀ = none⊢ Reaches zfMainStep c₀ ch; cases hn All goals completed! 🐙
· succ.some ch:ZfMainCfghnone:zfMainStep ch = nonen:ℕih:∀ {c₀ : ZfMainCfg}, zfMainNSteps n c₀ = some ch → Reaches zfMainStep c₀ chc₀:ZfMainCfghn:(zfMainStep c₀).bind (zfMainNSteps n) = some chc':ZfMainCfghs:zfMainStep c₀ = some c'⊢ Reaches zfMainStep c₀ ch rw [hs, succ.some ch:ZfMainCfghnone:zfMainStep ch = nonen:ℕih:∀ {c₀ : ZfMainCfg}, zfMainNSteps n c₀ = some ch → Reaches zfMainStep c₀ chc₀:ZfMainCfgc':ZfMainCfghn:(some c').bind (zfMainNSteps n) = some chhs:zfMainStep c₀ = some c'⊢ Reaches zfMainStep c₀ ch Option.bind_some succ.some ch:ZfMainCfghnone:zfMainStep ch = nonen:ℕih:∀ {c₀ : ZfMainCfg}, zfMainNSteps n c₀ = some ch → Reaches zfMainStep c₀ chc₀:ZfMainCfgc':ZfMainCfghn:zfMainNSteps n c' = some chhs:zfMainStep c₀ = some c'⊢ Reaches zfMainStep c₀ ch] at hn succ.some ch:ZfMainCfghnone:zfMainStep ch = nonen:ℕih:∀ {c₀ : ZfMainCfg}, zfMainNSteps n c₀ = some ch → Reaches zfMainStep c₀ chc₀:ZfMainCfgc':ZfMainCfghn:zfMainNSteps n c' = some chhs:zfMainStep c₀ = some c'⊢ Reaches zfMainStep c₀ ch
exact Relation.ReflTransGen.head hs (ih hn) mpr c₀:ZfMainCfgch:ZfMainCfgn:ℕhn:zfMainNSteps n c₀ = some chhnone:zfMainStep ch = nonehreach:Reaches zfMainStep c₀ ch⊢ ch ∈ eval zfMainStep c₀
exact StateTransition.mem_eval.mpr ⟨hreach, hnone⟩ All goals completed! 🐙theorem mainLoopHalts_iff_exists_zfMainNSteps :
MainLoopHalts ↔ ∃ n c, zfMainNSteps n zfMainInit = some c ∧ zfMainStep c = none := by ⊢ MainLoopHalts ↔ ∃ n c, zfMainNSteps n zfMainInit = some c ∧ zfMainStep c = none
unfold MainLoopHalts ⊢ (eval zfMainStep zfMainInit).Dom ↔ ∃ n c, zfMainNSteps n zfMainInit = some c ∧ zfMainStep c = none
rw [Part.dom_iff_mem ⊢ (∃ y, y ∈ eval zfMainStep zfMainInit) ↔ ∃ n c, zfMainNSteps n zfMainInit = some c ∧ zfMainStep c = none] ⊢ (∃ y, y ∈ eval zfMainStep zfMainInit) ↔ ∃ n c, zfMainNSteps n zfMainInit = some c ∧ zfMainStep c = none
simp only [mem_eval_zfMainStep_iff_zfMainNSteps] ⊢ (∃ y n, zfMainNSteps n zfMainInit = some y ∧ zfMainStep y = none) ↔
∃ n c, zfMainNSteps n zfMainInit = some c ∧ zfMainStep c = none
exact ⟨fun ⟨c, n, h⟩ => ⟨n, c, h⟩, fun ⟨n, c, h⟩ => ⟨c, n, h⟩⟩ All goals completed! 🐙
Section 4: WadeZFProvable and Soundness of zfMainStep
The n-th formula stored on the wff-stack (topwff, wffstack), unpacked via repeated
cantorUnpair.
def stackGet : ℕ → ℕ → ℕ → ℕ
| 0, top, _ => top
| n + 1, _, stk => stackGet n (cantorUnpair stk).1 (cantorUnpair stk).2@[simp]
theorem stackGet_zero (top stk : ℕ) : stackGet 0 top stk = top := rfl@[simp]
theorem stackGet_succ (n top stk : ℕ) :
stackGet (n + 1) top stk = stackGet n (cantorUnpair stk).1 (cantorUnpair stk).2 := rfl
Invariant stating that topwff and every formula encoded in wffstack is WadeZFProvable.
def StackAllProvable (top stk : ℕ) : Prop :=
∀ n : ℕ, WadeZFProvable (stackGet n top stk)theorem StackAllProvable.top {top stk : ℕ} (h : StackAllProvable top stk) :
WadeZFProvable top :=
h 0theorem StackAllProvable.push {φ top stk : ℕ} (hφ : WadeZFProvable φ)
(h : StackAllProvable top stk) :
StackAllProvable φ (cantorPair top stk) := by φ:ℕtop:ℕstk:ℕhφ:WadeZFProvable φh:StackAllProvable top stk⊢ StackAllProvable φ (cantorPair top stk)
intro n φ:ℕtop:ℕstk:ℕhφ:WadeZFProvable φh:StackAllProvable top stkn:ℕ⊢ WadeZFProvable (stackGet n φ (cantorPair top stk))
cases n with
| zero => zero φ:ℕtop:ℕstk:ℕhφ:WadeZFProvable φh:StackAllProvable top stk⊢ WadeZFProvable (stackGet 0 φ (cantorPair top stk)) exact hφ All goals completed! 🐙
| succ n => succ φ:ℕtop:ℕstk:ℕhφ:WadeZFProvable φh:StackAllProvable top stkn:ℕ⊢ WadeZFProvable (stackGet (n + 1) φ (cantorPair top stk))
simp only [stackGet_succ, cantorUnpair_cantorPair] succ φ:ℕtop:ℕstk:ℕhφ:WadeZFProvable φh:StackAllProvable top stkn:ℕ⊢ WadeZFProvable (stackGet n top stk)
exact h n All goals completed! 🐙theorem StackAllProvable.pop {top stk : ℕ} (h : StackAllProvable top stk) :
StackAllProvable (cantorUnpair stk).1 (cantorUnpair stk).2 := by top:ℕstk:ℕh:StackAllProvable top stk⊢ StackAllProvable (cantorUnpair stk).1 (cantorUnpair stk).2
intro n top:ℕstk:ℕh:StackAllProvable top stkn:ℕ⊢ WadeZFProvable (stackGet n (cantorUnpair stk).1 (cantorUnpair stk).2)
exact h (n + 1) All goals completed! 🐙theorem stackGet_zero_zero (n : ℕ) : stackGet n 0 0 = 0 := by n:ℕ⊢ stackGet n 0 0 = 0
induction n with
| zero => zero ⊢ stackGet 0 0 0 = 0 rfl All goals completed! 🐙
| succ n ih => succ n:ℕih:stackGet n 0 0 = 0⊢ stackGet (n + 1) 0 0 = 0 exact ih All goals completed! 🐙theorem stackAllProvable_init : StackAllProvable 0 0 := by ⊢ StackAllProvable 0 0
intro n n:ℕ⊢ WadeZFProvable (stackGet n 0 0)
rw [stackGet_zero_zero n:ℕ⊢ WadeZFProvable 0] n:ℕ⊢ WadeZFProvable 0
exact WadeZFProvable.moot All goals completed! 🐙theorem zfClauseDispatch_preserves_provable {topwff wffstack : ℕ}
(h : StackAllProvable topwff wffstack) (ac p1 p2 p3 : ℕ) :
let res := zfClauseDispatch topwff wffstack ac p1 p2 p3
StackAllProvable res.1 res.2 := by topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackac:ℕp1:ℕp2:ℕp3:ℕ⊢ let res := zfClauseDispatch topwff wffstack ac p1 p2 p3;
StackAllProvable res.1 res.2
have hmoot : WadeZFProvable 0 := WadeZFProvable.moot topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackac:ℕp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0⊢ let res := zfClauseDispatch topwff wffstack ac p1 p2 p3;
StackAllProvable res.1 res.2
have hpush0 : StackAllProvable 0 (cantorPair topwff wffstack) := h.push hmoot topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackac:ℕp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res := zfClauseDispatch topwff wffstack ac p1 p2 p3;
StackAllProvable res.1 res.2
rcases ac with _ | _ | _ | _ | _ | _ | _ | _ | _ | _ | _ | _ | _ | _ | _ | _ | _ | _ | _ | _ | ac zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res := zfClauseDispatch topwff wffstack 0 p1 p2 p3;
StackAllProvable res.1 res.2succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res := zfClauseDispatch topwff wffstack (0 + 1) p1 p2 p3;
StackAllProvable res.1 res.2succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res := zfClauseDispatch topwff wffstack (0 + 1 + 1) p1 p2 p3;
StackAllProvable res.1 res.2succ.succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res := zfClauseDispatch topwff wffstack (0 + 1 + 1 + 1) p1 p2 p3;
StackAllProvable res.1 res.2succ.succ.succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res := zfClauseDispatch topwff wffstack (0 + 1 + 1 + 1 + 1) p1 p2 p3;
StackAllProvable res.1 res.2succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res := zfClauseDispatch topwff wffstack (0 + 1 + 1 + 1 + 1 + 1) p1 p2 p3;
StackAllProvable res.1 res.2succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res := zfClauseDispatch topwff wffstack (0 + 1 + 1 + 1 + 1 + 1 + 1) p1 p2 p3;
StackAllProvable res.1 res.2succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res := zfClauseDispatch topwff wffstack (0 + 1 + 1 + 1 + 1 + 1 + 1 + 1) p1 p2 p3;
StackAllProvable res.1 res.2succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res := zfClauseDispatch topwff wffstack (0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) p1 p2 p3;
StackAllProvable res.1 res.2succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res := zfClauseDispatch topwff wffstack (0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) p1 p2 p3;
StackAllProvable res.1 res.2succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res := zfClauseDispatch topwff wffstack (0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) p1 p2 p3;
StackAllProvable res.1 res.2succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res := zfClauseDispatch topwff wffstack (0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) p1 p2 p3;
StackAllProvable res.1 res.2succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res := zfClauseDispatch topwff wffstack (0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) p1 p2 p3;
StackAllProvable res.1 res.2succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res := zfClauseDispatch topwff wffstack (0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) p1 p2 p3;
StackAllProvable res.1 res.2succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res := zfClauseDispatch topwff wffstack (0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) p1 p2 p3;
StackAllProvable res.1 res.2succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res := zfClauseDispatch topwff wffstack (0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) p1 p2 p3;
StackAllProvable res.1 res.2succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res :=
zfClauseDispatch topwff wffstack (0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) p1 p2 p3;
StackAllProvable res.1 res.2succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res :=
zfClauseDispatch topwff wffstack (0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) p1 p2 p3;
StackAllProvable res.1 res.2succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res :=
zfClauseDispatch topwff wffstack (0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) p1 p2 p3;
StackAllProvable res.1 res.2succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res :=
zfClauseDispatch topwff wffstack (0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) p1 p2
p3;
StackAllProvable res.1 res.2succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)ac:ℕ⊢ let res :=
zfClauseDispatch topwff wffstack (ac + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1)
p1 p2 p3;
StackAllProvable res.1 res.2
· zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res := zfClauseDispatch topwff wffstack 0 p1 p2 p3;
StackAllProvable res.1 res.2 exact hpush0 All goals completed! 🐙
· succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res := zfClauseDispatch topwff wffstack (0 + 1) p1 p2 p3;
StackAllProvable res.1 res.2 -- ac = 1 (DET)
dsimp only [zfClauseDispatch] succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ StackAllProvable
(if
zfImp (cantorUnpair (cantorPair topwff wffstack)).1 p1 =
(cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1 then
(p1, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2)
else (0, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2)).1
(if
zfImp (cantorUnpair (cantorPair topwff wffstack)).1 p1 =
(cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1 then
(p1, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2)
else (0, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2)).2
have hpop1 := hpush0.pop succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)hpop1:StackAllProvable (cantorUnpair (cantorPair topwff wffstack)).1 (cantorUnpair (cantorPair topwff wffstack)).2⊢ StackAllProvable
(if
zfImp (cantorUnpair (cantorPair topwff wffstack)).1 p1 =
(cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1 then
(p1, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2)
else (0, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2)).1
(if
zfImp (cantorUnpair (cantorPair topwff wffstack)).1 p1 =
(cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1 then
(p1, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2)
else (0, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2)).2
have hφ : WadeZFProvable (cantorUnpair (cantorPair topwff wffstack)).1 := hpop1.top succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)hpop1:StackAllProvable (cantorUnpair (cantorPair topwff wffstack)).1 (cantorUnpair (cantorPair topwff wffstack)).2hφ:WadeZFProvable (cantorUnpair (cantorPair topwff wffstack)).1⊢ StackAllProvable
(if
zfImp (cantorUnpair (cantorPair topwff wffstack)).1 p1 =
(cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1 then
(p1, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2)
else (0, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2)).1
(if
zfImp (cantorUnpair (cantorPair topwff wffstack)).1 p1 =
(cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1 then
(p1, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2)
else (0, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2)).2
have hpop2 := hpop1.pop succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)hpop1:StackAllProvable (cantorUnpair (cantorPair topwff wffstack)).1 (cantorUnpair (cantorPair topwff wffstack)).2hφ:WadeZFProvable (cantorUnpair (cantorPair topwff wffstack)).1hpop2:StackAllProvable (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1
(cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2⊢ StackAllProvable
(if
zfImp (cantorUnpair (cantorPair topwff wffstack)).1 p1 =
(cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1 then
(p1, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2)
else (0, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2)).1
(if
zfImp (cantorUnpair (cantorPair topwff wffstack)).1 p1 =
(cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1 then
(p1, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2)
else (0, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2)).2
have hmaj : WadeZFProvable (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1 :=
hpop2.top succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)hpop1:StackAllProvable (cantorUnpair (cantorPair topwff wffstack)).1 (cantorUnpair (cantorPair topwff wffstack)).2hφ:WadeZFProvable (cantorUnpair (cantorPair topwff wffstack)).1hpop2:StackAllProvable (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1
(cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2hmaj:WadeZFProvable (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1⊢ StackAllProvable
(if
zfImp (cantorUnpair (cantorPair topwff wffstack)).1 p1 =
(cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1 then
(p1, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2)
else (0, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2)).1
(if
zfImp (cantorUnpair (cantorPair topwff wffstack)).1 p1 =
(cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1 then
(p1, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2)
else (0, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2)).2
split_ifs with hmp pos topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)hpop1:StackAllProvable (cantorUnpair (cantorPair topwff wffstack)).1 (cantorUnpair (cantorPair topwff wffstack)).2hφ:WadeZFProvable (cantorUnpair (cantorPair topwff wffstack)).1hpop2:StackAllProvable (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1
(cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2hmaj:WadeZFProvable (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1hmp:zfImp (cantorUnpair (cantorPair topwff wffstack)).1 p1 = (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1⊢ StackAllProvable (p1, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2).1
(p1, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2).2neg topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)hpop1:StackAllProvable (cantorUnpair (cantorPair topwff wffstack)).1 (cantorUnpair (cantorPair topwff wffstack)).2hφ:WadeZFProvable (cantorUnpair (cantorPair topwff wffstack)).1hpop2:StackAllProvable (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1
(cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2hmaj:WadeZFProvable (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1hmp:¬zfImp (cantorUnpair (cantorPair topwff wffstack)).1 p1 = (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1⊢ StackAllProvable (0, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2).1
(0, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2).2
· pos topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)hpop1:StackAllProvable (cantorUnpair (cantorPair topwff wffstack)).1 (cantorUnpair (cantorPair topwff wffstack)).2hφ:WadeZFProvable (cantorUnpair (cantorPair topwff wffstack)).1hpop2:StackAllProvable (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1
(cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2hmaj:WadeZFProvable (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1hmp:zfImp (cantorUnpair (cantorPair topwff wffstack)).1 p1 = (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1⊢ StackAllProvable (p1, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2).1
(p1, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2).2 rw [← hmp pos topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)hpop1:StackAllProvable (cantorUnpair (cantorPair topwff wffstack)).1 (cantorUnpair (cantorPair topwff wffstack)).2hφ:WadeZFProvable (cantorUnpair (cantorPair topwff wffstack)).1hpop2:StackAllProvable (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1
(cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2hmaj:WadeZFProvable (zfImp (cantorUnpair (cantorPair topwff wffstack)).1 p1)hmp:zfImp (cantorUnpair (cantorPair topwff wffstack)).1 p1 = (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1⊢ StackAllProvable (p1, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2).1
(p1, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2).2] at hmaj pos topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)hpop1:StackAllProvable (cantorUnpair (cantorPair topwff wffstack)).1 (cantorUnpair (cantorPair topwff wffstack)).2hφ:WadeZFProvable (cantorUnpair (cantorPair topwff wffstack)).1hpop2:StackAllProvable (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1
(cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2hmaj:WadeZFProvable (zfImp (cantorUnpair (cantorPair topwff wffstack)).1 p1)hmp:zfImp (cantorUnpair (cantorPair topwff wffstack)).1 p1 = (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1⊢ StackAllProvable (p1, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2).1
(p1, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2).2
have hp1 : WadeZFProvable p1 := WadeZFProvable.mp hφ hmaj pos topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)hpop1:StackAllProvable (cantorUnpair (cantorPair topwff wffstack)).1 (cantorUnpair (cantorPair topwff wffstack)).2hφ:WadeZFProvable (cantorUnpair (cantorPair topwff wffstack)).1hpop2:StackAllProvable (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1
(cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2hmaj:WadeZFProvable (zfImp (cantorUnpair (cantorPair topwff wffstack)).1 p1)hmp:zfImp (cantorUnpair (cantorPair topwff wffstack)).1 p1 = (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1hp1:WadeZFProvable p1⊢ StackAllProvable (p1, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2).1
(p1, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2).2
intro n pos topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)hpop1:StackAllProvable (cantorUnpair (cantorPair topwff wffstack)).1 (cantorUnpair (cantorPair topwff wffstack)).2hφ:WadeZFProvable (cantorUnpair (cantorPair topwff wffstack)).1hpop2:StackAllProvable (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1
(cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2hmaj:WadeZFProvable (zfImp (cantorUnpair (cantorPair topwff wffstack)).1 p1)hmp:zfImp (cantorUnpair (cantorPair topwff wffstack)).1 p1 = (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1hp1:WadeZFProvable p1n:ℕ⊢ WadeZFProvable
(stackGet n (p1, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2).1
(p1, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2).2)
cases n with
| zero => pos.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)hpop1:StackAllProvable (cantorUnpair (cantorPair topwff wffstack)).1 (cantorUnpair (cantorPair topwff wffstack)).2hφ:WadeZFProvable (cantorUnpair (cantorPair topwff wffstack)).1hpop2:StackAllProvable (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1
(cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2hmaj:WadeZFProvable (zfImp (cantorUnpair (cantorPair topwff wffstack)).1 p1)hmp:zfImp (cantorUnpair (cantorPair topwff wffstack)).1 p1 = (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1hp1:WadeZFProvable p1⊢ WadeZFProvable
(stackGet 0 (p1, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2).1
(p1, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2).2) exact hp1 All goals completed! 🐙
| succ n => pos.succ topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)hpop1:StackAllProvable (cantorUnpair (cantorPair topwff wffstack)).1 (cantorUnpair (cantorPair topwff wffstack)).2hφ:WadeZFProvable (cantorUnpair (cantorPair topwff wffstack)).1hpop2:StackAllProvable (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1
(cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2hmaj:WadeZFProvable (zfImp (cantorUnpair (cantorPair topwff wffstack)).1 p1)hmp:zfImp (cantorUnpair (cantorPair topwff wffstack)).1 p1 = (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1hp1:WadeZFProvable p1n:ℕ⊢ WadeZFProvable
(stackGet (n + 1) (p1, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2).1
(p1, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2).2) exact hpop2 (n + 1) All goals completed! 🐙
· neg topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)hpop1:StackAllProvable (cantorUnpair (cantorPair topwff wffstack)).1 (cantorUnpair (cantorPair topwff wffstack)).2hφ:WadeZFProvable (cantorUnpair (cantorPair topwff wffstack)).1hpop2:StackAllProvable (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1
(cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2hmaj:WadeZFProvable (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1hmp:¬zfImp (cantorUnpair (cantorPair topwff wffstack)).1 p1 = (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1⊢ StackAllProvable (0, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2).1
(0, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2).2 intro n neg topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)hpop1:StackAllProvable (cantorUnpair (cantorPair topwff wffstack)).1 (cantorUnpair (cantorPair topwff wffstack)).2hφ:WadeZFProvable (cantorUnpair (cantorPair topwff wffstack)).1hpop2:StackAllProvable (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1
(cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2hmaj:WadeZFProvable (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1hmp:¬zfImp (cantorUnpair (cantorPair topwff wffstack)).1 p1 = (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1n:ℕ⊢ WadeZFProvable
(stackGet n (0, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2).1
(0, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2).2)
cases n with
| zero => neg.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)hpop1:StackAllProvable (cantorUnpair (cantorPair topwff wffstack)).1 (cantorUnpair (cantorPair topwff wffstack)).2hφ:WadeZFProvable (cantorUnpair (cantorPair topwff wffstack)).1hpop2:StackAllProvable (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1
(cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2hmaj:WadeZFProvable (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1hmp:¬zfImp (cantorUnpair (cantorPair topwff wffstack)).1 p1 = (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1⊢ WadeZFProvable
(stackGet 0 (0, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2).1
(0, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2).2) exact hmoot All goals completed! 🐙
| succ n => neg.succ topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)hpop1:StackAllProvable (cantorUnpair (cantorPair topwff wffstack)).1 (cantorUnpair (cantorPair topwff wffstack)).2hφ:WadeZFProvable (cantorUnpair (cantorPair topwff wffstack)).1hpop2:StackAllProvable (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1
(cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2hmaj:WadeZFProvable (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1hmp:¬zfImp (cantorUnpair (cantorPair topwff wffstack)).1 p1 = (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).1n:ℕ⊢ WadeZFProvable
(stackGet (n + 1) (0, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2).1
(0, (cantorUnpair (cantorUnpair (cantorPair topwff wffstack)).2).2).2) exact hpop2 (n + 1) All goals completed! 🐙
· succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res := zfClauseDispatch topwff wffstack (0 + 1 + 1) p1 p2 p3;
StackAllProvable res.1 res.2 -- ac = 2 (GEN)
dsimp only [zfClauseDispatch] succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ StackAllProvable (zfAll p1 (cantorUnpair (cantorPair topwff wffstack)).1) (cantorUnpair (cantorPair topwff wffstack)).2
have hpop1 := hpush0.pop succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)hpop1:StackAllProvable (cantorUnpair (cantorPair topwff wffstack)).1 (cantorUnpair (cantorPair topwff wffstack)).2⊢ StackAllProvable (zfAll p1 (cantorUnpair (cantorPair topwff wffstack)).1) (cantorUnpair (cantorPair topwff wffstack)).2
have hall : WadeZFProvable (zfAll p1 (cantorUnpair (cantorPair topwff wffstack)).1) :=
WadeZFProvable.gen p1 hpop1.top succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)hpop1:StackAllProvable (cantorUnpair (cantorPair topwff wffstack)).1 (cantorUnpair (cantorPair topwff wffstack)).2hall:WadeZFProvable (zfAll p1 (cantorUnpair (cantorPair topwff wffstack)).1)⊢ StackAllProvable (zfAll p1 (cantorUnpair (cantorPair topwff wffstack)).1) (cantorUnpair (cantorPair topwff wffstack)).2
intro n succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)hpop1:StackAllProvable (cantorUnpair (cantorPair topwff wffstack)).1 (cantorUnpair (cantorPair topwff wffstack)).2hall:WadeZFProvable (zfAll p1 (cantorUnpair (cantorPair topwff wffstack)).1)n:ℕ⊢ WadeZFProvable
(stackGet n (zfAll p1 (cantorUnpair (cantorPair topwff wffstack)).1) (cantorUnpair (cantorPair topwff wffstack)).2)
cases n with
| zero => succ.succ.zero.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)hpop1:StackAllProvable (cantorUnpair (cantorPair topwff wffstack)).1 (cantorUnpair (cantorPair topwff wffstack)).2hall:WadeZFProvable (zfAll p1 (cantorUnpair (cantorPair topwff wffstack)).1)⊢ WadeZFProvable
(stackGet 0 (zfAll p1 (cantorUnpair (cantorPair topwff wffstack)).1) (cantorUnpair (cantorPair topwff wffstack)).2) exact hall All goals completed! 🐙
| succ n => succ.succ.zero.succ topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)hpop1:StackAllProvable (cantorUnpair (cantorPair topwff wffstack)).1 (cantorUnpair (cantorPair topwff wffstack)).2hall:WadeZFProvable (zfAll p1 (cantorUnpair (cantorPair topwff wffstack)).1)n:ℕ⊢ WadeZFProvable
(stackGet (n + 1) (zfAll p1 (cantorUnpair (cantorPair topwff wffstack)).1)
(cantorUnpair (cantorPair topwff wffstack)).2) exact hpop1 (n + 1) All goals completed! 🐙
· succ.succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res := zfClauseDispatch topwff wffstack (0 + 1 + 1 + 1) p1 p2 p3;
StackAllProvable res.1 res.2 exact h.push (WadeZFProvable.b1 p1 p2 p3) All goals completed! 🐙
· succ.succ.succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res := zfClauseDispatch topwff wffstack (0 + 1 + 1 + 1 + 1) p1 p2 p3;
StackAllProvable res.1 res.2 exact h.push (WadeZFProvable.b2 p1) All goals completed! 🐙
· succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res := zfClauseDispatch topwff wffstack (0 + 1 + 1 + 1 + 1 + 1) p1 p2 p3;
StackAllProvable res.1 res.2 exact h.push (WadeZFProvable.b3 p1 p2) All goals completed! 🐙
· succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res := zfClauseDispatch topwff wffstack (0 + 1 + 1 + 1 + 1 + 1 + 1) p1 p2 p3;
StackAllProvable res.1 res.2 exact h.push (WadeZFProvable.b4 p1 p2 p3) All goals completed! 🐙
· succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res := zfClauseDispatch topwff wffstack (0 + 1 + 1 + 1 + 1 + 1 + 1 + 1) p1 p2 p3;
StackAllProvable res.1 res.2 exact h.push (WadeZFProvable.b6b p1 p2 p3) All goals completed! 🐙
· succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res := zfClauseDispatch topwff wffstack (0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) p1 p2 p3;
StackAllProvable res.1 res.2 exact h.push (WadeZFProvable.b8b p1 p2 p3) All goals completed! 🐙
· succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res := zfClauseDispatch topwff wffstack (0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) p1 p2 p3;
StackAllProvable res.1 res.2 -- ac = 9 (B6a)
dsimp only [zfClauseDispatch] succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ StackAllProvable
(if p1 = p3 ∨ p2 = 0 then (0, cantorPair topwff wffstack) else (axB6a p1 p2 p3, cantorPair topwff wffstack)).1
(if p1 = p3 ∨ p2 = 0 then (0, cantorPair topwff wffstack) else (axB6a p1 p2 p3, cantorPair topwff wffstack)).2
split_ifs with h6a pos topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)h6a:p1 = p3 ∨ p2 = 0⊢ StackAllProvable (0, cantorPair topwff wffstack).1 (0, cantorPair topwff wffstack).2neg topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)h6a:¬(p1 = p3 ∨ p2 = 0)⊢ StackAllProvable (axB6a p1 p2 p3, cantorPair topwff wffstack).1 (axB6a p1 p2 p3, cantorPair topwff wffstack).2
· pos topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)h6a:p1 = p3 ∨ p2 = 0⊢ StackAllProvable (0, cantorPair topwff wffstack).1 (0, cantorPair topwff wffstack).2 exact hpush0 All goals completed! 🐙
· neg topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)h6a:¬(p1 = p3 ∨ p2 = 0)⊢ StackAllProvable (axB6a p1 p2 p3, cantorPair topwff wffstack).1 (axB6a p1 p2 p3, cantorPair topwff wffstack).2 rcases not_or.mp h6a with ⟨hne1, hne2⟩ neg topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)h6a:¬(p1 = p3 ∨ p2 = 0)hne1:¬p1 = p3hne2:¬p2 = 0⊢ StackAllProvable (axB6a p1 p2 p3, cantorPair topwff wffstack).1 (axB6a p1 p2 p3, cantorPair topwff wffstack).2
exact h.push (WadeZFProvable.b6a_wade p1 p2 p3 hne1 hne2) All goals completed! 🐙
· succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res := zfClauseDispatch topwff wffstack (0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) p1 p2 p3;
StackAllProvable res.1 res.2 exact h.push (WadeZFProvable.b6b (p1 + p3) p2 0) All goals completed! 🐙
· succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res := zfClauseDispatch topwff wffstack (0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) p1 p2 p3;
StackAllProvable res.1 res.2 exact h.push (WadeZFProvable.b6c (p1 + p3) p2) All goals completed! 🐙
· succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res := zfClauseDispatch topwff wffstack (0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) p1 p2 p3;
StackAllProvable res.1 res.2 exact h.push (WadeZFProvable.b7 (p1 + p3) p2) All goals completed! 🐙
· succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res := zfClauseDispatch topwff wffstack (0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) p1 p2 p3;
StackAllProvable res.1 res.2 exact h.push (WadeZFProvable.b8a_zero (p1 + p3) p2) All goals completed! 🐙
· succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res := zfClauseDispatch topwff wffstack (0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) p1 p2 p3;
StackAllProvable res.1 res.2 exact h.push (WadeZFProvable.b8b (p1 + p3) p2 0) All goals completed! 🐙
· succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res := zfClauseDispatch topwff wffstack (0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) p1 p2 p3;
StackAllProvable res.1 res.2 exact h.push (WadeZFProvable.b8c_zero (p1 + p3) p2) All goals completed! 🐙
· succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res :=
zfClauseDispatch topwff wffstack (0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) p1 p2 p3;
StackAllProvable res.1 res.2 exact h.push WadeZFProvable.ext All goals completed! 🐙
· succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res :=
zfClauseDispatch topwff wffstack (0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) p1 p2 p3;
StackAllProvable res.1 res.2 exact h.push (WadeZFProvable.rep (p1 + p3)) All goals completed! 🐙
· succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res :=
zfClauseDispatch topwff wffstack (0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) p1 p2 p3;
StackAllProvable res.1 res.2 exact h.push WadeZFProvable.pow All goals completed! 🐙
· succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.zero topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)⊢ let res :=
zfClauseDispatch topwff wffstack (0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) p1 p2
p3;
StackAllProvable res.1 res.2 exact h.push WadeZFProvable.uni All goals completed! 🐙
· succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ topwff:ℕwffstack:ℕh:StackAllProvable topwff wffstackp1:ℕp2:ℕp3:ℕhmoot:WadeZFProvable 0hpush0:StackAllProvable 0 (cantorPair topwff wffstack)ac:ℕ⊢ let res :=
zfClauseDispatch topwff wffstack (ac + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1)
p1 p2 p3;
StackAllProvable res.1 res.2 exact h.push WadeZFProvable.inf All goals completed! 🐙theorem zfMainNext_preserves_provable {c : ZfMainCfg}
(h : StackAllProvable c.topwff c.wffstack) :
StackAllProvable (zfMainNext c).topwff (zfMainNext c).wffstack := by c:ZfMainCfgh:StackAllProvable c.topwff c.wffstack⊢ StackAllProvable (zfMainNext c).topwff (zfMainNext c).wffstack
unfold zfMainNext c:ZfMainCfgh:StackAllProvable c.topwff c.wffstack⊢ StackAllProvable
(have prooflist₁ := if c.prooflist = 0 then c.nextproof else c.prooflist - 1;
have nextproof' := if c.prooflist = 0 then c.nextproof + 1 else c.nextproof;
have u1 := cantorUnpair prooflist₁;
have ac := u1.1;
have u2 := cantorUnpair u1.2;
have p1 := u2.1;
have u3 := cantorUnpair u2.2;
have p2 := u3.1;
have u4 := cantorUnpair u3.2;
have p3 := u4.1;
have prooflist' := u4.2;
have res := zfClauseDispatch c.topwff c.wffstack ac p1 p2 p3;
{ prooflist := prooflist', nextproof := nextproof', topwff := res.1, wffstack := res.2 }).topwff
(have prooflist₁ := if c.prooflist = 0 then c.nextproof else c.prooflist - 1;
have nextproof' := if c.prooflist = 0 then c.nextproof + 1 else c.nextproof;
have u1 := cantorUnpair prooflist₁;
have ac := u1.1;
have u2 := cantorUnpair u1.2;
have p1 := u2.1;
have u3 := cantorUnpair u2.2;
have p2 := u3.1;
have u4 := cantorUnpair u3.2;
have p3 := u4.1;
have prooflist' := u4.2;
have res := zfClauseDispatch c.topwff c.wffstack ac p1 p2 p3;
{ prooflist := prooflist', nextproof := nextproof', topwff := res.1, wffstack := res.2 }).wffstack
exact zfClauseDispatch_preserves_provable h _ _ _ _ All goals completed! 🐙theorem zfMainNSteps_preserves_provable {n : ℕ} {c₁ c₂ : ZfMainCfg}
(h : StackAllProvable c₁.topwff c₁.wffstack)
(hsteps : zfMainNSteps n c₁ = some c₂) :
StackAllProvable c₂.topwff c₂.wffstack := by n:ℕc₁:ZfMainCfgc₂:ZfMainCfgh:StackAllProvable c₁.topwff c₁.wffstackhsteps:zfMainNSteps n c₁ = some c₂⊢ StackAllProvable c₂.topwff c₂.wffstack
induction n generalizing c₁ with
| zero => zero c₂:ZfMainCfgc₁:ZfMainCfgh:StackAllProvable c₁.topwff c₁.wffstackhsteps:zfMainNSteps 0 c₁ = some c₂⊢ StackAllProvable c₂.topwff c₂.wffstack
injection hsteps with h' zero c₂:ZfMainCfgc₁:ZfMainCfgh:StackAllProvable c₁.topwff c₁.wffstackh':c₁ = c₂⊢ StackAllProvable c₂.topwff c₂.wffstack
subst h' zero c₁:ZfMainCfgh:StackAllProvable c₁.topwff c₁.wffstack⊢ StackAllProvable c₁.topwff c₁.wffstack
exact h All goals completed! 🐙
| succ n ih => succ c₂:ZfMainCfgn:ℕih:∀ {c₁ : ZfMainCfg},
StackAllProvable c₁.topwff c₁.wffstack → zfMainNSteps n c₁ = some c₂ → StackAllProvable c₂.topwff c₂.wffstackc₁:ZfMainCfgh:StackAllProvable c₁.topwff c₁.wffstackhsteps:zfMainNSteps (n + 1) c₁ = some c₂⊢ StackAllProvable c₂.topwff c₂.wffstack
unfold zfMainNSteps at hsteps succ c₂:ZfMainCfgn:ℕih:∀ {c₁ : ZfMainCfg},
StackAllProvable c₁.topwff c₁.wffstack → zfMainNSteps n c₁ = some c₂ → StackAllProvable c₂.topwff c₂.wffstackc₁:ZfMainCfgh:StackAllProvable c₁.topwff c₁.wffstackhsteps:(zfMainStep c₁).bind (zfMainNSteps n) = some c₂⊢ StackAllProvable c₂.topwff c₂.wffstack
rcases hs : zfMainStep c₁ with _ | c' succ.none c₂:ZfMainCfgn:ℕih:∀ {c₁ : ZfMainCfg},
StackAllProvable c₁.topwff c₁.wffstack → zfMainNSteps n c₁ = some c₂ → StackAllProvable c₂.topwff c₂.wffstackc₁:ZfMainCfgh:StackAllProvable c₁.topwff c₁.wffstackhsteps:(zfMainStep c₁).bind (zfMainNSteps n) = some c₂hs:zfMainStep c₁ = none⊢ StackAllProvable c₂.topwff c₂.wffstacksucc.some c₂:ZfMainCfgn:ℕih:∀ {c₁ : ZfMainCfg},
StackAllProvable c₁.topwff c₁.wffstack → zfMainNSteps n c₁ = some c₂ → StackAllProvable c₂.topwff c₂.wffstackc₁:ZfMainCfgh:StackAllProvable c₁.topwff c₁.wffstackhsteps:(zfMainStep c₁).bind (zfMainNSteps n) = some c₂c':ZfMainCfghs:zfMainStep c₁ = some c'⊢ StackAllProvable c₂.topwff c₂.wffstack
· succ.none c₂:ZfMainCfgn:ℕih:∀ {c₁ : ZfMainCfg},
StackAllProvable c₁.topwff c₁.wffstack → zfMainNSteps n c₁ = some c₂ → StackAllProvable c₂.topwff c₂.wffstackc₁:ZfMainCfgh:StackAllProvable c₁.topwff c₁.wffstackhsteps:(zfMainStep c₁).bind (zfMainNSteps n) = some c₂hs:zfMainStep c₁ = none⊢ StackAllProvable c₂.topwff c₂.wffstack rw [hs succ.none c₂:ZfMainCfgn:ℕih:∀ {c₁ : ZfMainCfg},
StackAllProvable c₁.topwff c₁.wffstack → zfMainNSteps n c₁ = some c₂ → StackAllProvable c₂.topwff c₂.wffstackc₁:ZfMainCfgh:StackAllProvable c₁.topwff c₁.wffstackhsteps:none.bind (zfMainNSteps n) = some c₂hs:zfMainStep c₁ = none⊢ StackAllProvable c₂.topwff c₂.wffstack] at hsteps succ.none c₂:ZfMainCfgn:ℕih:∀ {c₁ : ZfMainCfg},
StackAllProvable c₁.topwff c₁.wffstack → zfMainNSteps n c₁ = some c₂ → StackAllProvable c₂.topwff c₂.wffstackc₁:ZfMainCfgh:StackAllProvable c₁.topwff c₁.wffstackhsteps:none.bind (zfMainNSteps n) = some c₂hs:zfMainStep c₁ = none⊢ StackAllProvable c₂.topwff c₂.wffstack; cases hsteps All goals completed! 🐙
· succ.some c₂:ZfMainCfgn:ℕih:∀ {c₁ : ZfMainCfg},
StackAllProvable c₁.topwff c₁.wffstack → zfMainNSteps n c₁ = some c₂ → StackAllProvable c₂.topwff c₂.wffstackc₁:ZfMainCfgh:StackAllProvable c₁.topwff c₁.wffstackhsteps:(zfMainStep c₁).bind (zfMainNSteps n) = some c₂c':ZfMainCfghs:zfMainStep c₁ = some c'⊢ StackAllProvable c₂.topwff c₂.wffstack rw [hs, succ.some c₂:ZfMainCfgn:ℕih:∀ {c₁ : ZfMainCfg},
StackAllProvable c₁.topwff c₁.wffstack → zfMainNSteps n c₁ = some c₂ → StackAllProvable c₂.topwff c₂.wffstackc₁:ZfMainCfgh:StackAllProvable c₁.topwff c₁.wffstackc':ZfMainCfghsteps:(some c').bind (zfMainNSteps n) = some c₂hs:zfMainStep c₁ = some c'⊢ StackAllProvable c₂.topwff c₂.wffstack Option.bind_some succ.some c₂:ZfMainCfgn:ℕih:∀ {c₁ : ZfMainCfg},
StackAllProvable c₁.topwff c₁.wffstack → zfMainNSteps n c₁ = some c₂ → StackAllProvable c₂.topwff c₂.wffstackc₁:ZfMainCfgh:StackAllProvable c₁.topwff c₁.wffstackc':ZfMainCfghsteps:zfMainNSteps n c' = some c₂hs:zfMainStep c₁ = some c'⊢ StackAllProvable c₂.topwff c₂.wffstack] at hsteps succ.some c₂:ZfMainCfgn:ℕih:∀ {c₁ : ZfMainCfg},
StackAllProvable c₁.topwff c₁.wffstack → zfMainNSteps n c₁ = some c₂ → StackAllProvable c₂.topwff c₂.wffstackc₁:ZfMainCfgh:StackAllProvable c₁.topwff c₁.wffstackc':ZfMainCfghsteps:zfMainNSteps n c' = some c₂hs:zfMainStep c₁ = some c'⊢ StackAllProvable c₂.topwff c₂.wffstack
unfold zfMainStep at hs succ.some c₂:ZfMainCfgn:ℕih:∀ {c₁ : ZfMainCfg},
StackAllProvable c₁.topwff c₁.wffstack → zfMainNSteps n c₁ = some c₂ → StackAllProvable c₂.topwff c₂.wffstackc₁:ZfMainCfgh:StackAllProvable c₁.topwff c₁.wffstackc':ZfMainCfghsteps:zfMainNSteps n c' = some c₂hs:(if (zfMainNext c₁).topwff = 1 then none else some (zfMainNext c₁)) = some c'⊢ StackAllProvable c₂.topwff c₂.wffstack
split_ifs at hs with h1 neg c₂:ZfMainCfgn:ℕih:∀ {c₁ : ZfMainCfg},
StackAllProvable c₁.topwff c₁.wffstack → zfMainNSteps n c₁ = some c₂ → StackAllProvable c₂.topwff c₂.wffstackc₁:ZfMainCfgh:StackAllProvable c₁.topwff c₁.wffstackc':ZfMainCfghsteps:zfMainNSteps n c' = some c₂h1:¬(zfMainNext c₁).topwff = 1hs:some (zfMainNext c₁) = some c'⊢ StackAllProvable c₂.topwff c₂.wffstack
injection hs with hs' neg c₂:ZfMainCfgn:ℕih:∀ {c₁ : ZfMainCfg},
StackAllProvable c₁.topwff c₁.wffstack → zfMainNSteps n c₁ = some c₂ → StackAllProvable c₂.topwff c₂.wffstackc₁:ZfMainCfgh:StackAllProvable c₁.topwff c₁.wffstackc':ZfMainCfghsteps:zfMainNSteps n c' = some c₂h1:¬(zfMainNext c₁).topwff = 1hs':zfMainNext c₁ = c'⊢ StackAllProvable c₂.topwff c₂.wffstack
subst hs' neg c₂:ZfMainCfgn:ℕih:∀ {c₁ : ZfMainCfg},
StackAllProvable c₁.topwff c₁.wffstack → zfMainNSteps n c₁ = some c₂ → StackAllProvable c₂.topwff c₂.wffstackc₁:ZfMainCfgh:StackAllProvable c₁.topwff c₁.wffstackh1:¬(zfMainNext c₁).topwff = 1hsteps:zfMainNSteps n (zfMainNext c₁) = some c₂⊢ StackAllProvable c₂.topwff c₂.wffstack
exact ih (zfMainNext_preserves_provable h) hsteps All goals completed! 🐙
Soundness of zfMainStep: if MainLoopHalts, then WadeZFInconsistent holds.
theorem wadeZFInconsistent_of_mainLoopHalts (hHalts : MainLoopHalts) : WadeZFInconsistent := by hHalts:MainLoopHalts⊢ WadeZFInconsistent
obtain ⟨n, c, hn, hnone⟩ := mainLoopHalts_iff_exists_zfMainNSteps.mp hHalts hHalts:MainLoopHaltsn:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some chnone:zfMainStep c = none⊢ WadeZFInconsistent
have hprov : StackAllProvable c.topwff c.wffstack :=
zfMainNSteps_preserves_provable stackAllProvable_init hn hHalts:MainLoopHaltsn:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some chnone:zfMainStep c = nonehprov:StackAllProvable c.topwff c.wffstack⊢ WadeZFInconsistent
have hnext : StackAllProvable (zfMainNext c).topwff (zfMainNext c).wffstack :=
zfMainNext_preserves_provable hprov hHalts:MainLoopHaltsn:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some chnone:zfMainStep c = nonehprov:StackAllProvable c.topwff c.wffstackhnext:StackAllProvable (zfMainNext c).topwff (zfMainNext c).wffstack⊢ WadeZFInconsistent
unfold zfMainStep at hnone hHalts:MainLoopHaltsn:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some chnone:(if (zfMainNext c).topwff = 1 then none else some (zfMainNext c)) = nonehprov:StackAllProvable c.topwff c.wffstackhnext:StackAllProvable (zfMainNext c).topwff (zfMainNext c).wffstack⊢ WadeZFInconsistent
split_ifs at hnone with htop1 pos hHalts:MainLoopHaltsn:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some chprov:StackAllProvable c.topwff c.wffstackhnext:StackAllProvable (zfMainNext c).topwff (zfMainNext c).wffstackhtop1:(zfMainNext c).topwff = 1hnone:none = none⊢ WadeZFInconsistent
have h1 : WadeZFProvable (zfMainNext c).topwff := hnext.top pos hHalts:MainLoopHaltsn:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some chprov:StackAllProvable c.topwff c.wffstackhnext:StackAllProvable (zfMainNext c).topwff (zfMainNext c).wffstackhtop1:(zfMainNext c).topwff = 1hnone:none = noneh1:WadeZFProvable (zfMainNext c).topwff⊢ WadeZFInconsistent
rw [htop1 pos hHalts:MainLoopHaltsn:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some chprov:StackAllProvable c.topwff c.wffstackhnext:StackAllProvable (zfMainNext c).topwff (zfMainNext c).wffstackhtop1:(zfMainNext c).topwff = 1hnone:none = noneh1:WadeZFProvable 1⊢ WadeZFInconsistent] at h1 pos hHalts:MainLoopHaltsn:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some chprov:StackAllProvable c.topwff c.wffstackhnext:StackAllProvable (zfMainNext c).topwff (zfMainNext c).wffstackhtop1:(zfMainNext c).topwff = 1hnone:none = noneh1:WadeZFProvable 1⊢ WadeZFInconsistent
exact h1 All goals completed! 🐙
Section 5: Completeness of zfMainStep (WadeZFInconsistent → MainLoopHalts)
A single proof step (axiomcode, param1, param2, param3).
abbrev ProofStep := ℕ × ℕ × ℕ × ℕ
Execute a single ProofStep on (topwff, wffstack).
def execProofStep (s : ProofStep) (p : ℕ × ℕ) : ℕ × ℕ :=
zfClauseDispatch p.1 p.2 s.1 s.2.1 s.2.2.1 s.2.2.2
Execute a list of ProofSteps sequentially on (topwff, wffstack).
def execProofList : List ProofStep → ℕ × ℕ → ℕ × ℕ
| [], p => p
| s :: rest, p => execProofList rest (execProofStep s p)@[simp]
theorem execProofList_nil (p : ℕ × ℕ) : execProofList [] p = p := rfl@[simp]
theorem execProofList_cons (s : ProofStep) (rest : List ProofStep) (p : ℕ × ℕ) :
execProofList (s :: rest) p = execProofList rest (execProofStep s p) := rfl@[simp]
theorem execProofList_append (L₁ L₂ : List ProofStep) (p : ℕ × ℕ) :
execProofList (L₁ ++ L₂) p = execProofList L₂ (execProofList L₁ p) := by L₁:List ProofStepL₂:List ProofStepp:ℕ × ℕ⊢ execProofList (L₁ ++ L₂) p = execProofList L₂ (execProofList L₁ p)
induction L₁ generalizing p with
| nil => nil L₂:List ProofStepp:ℕ × ℕ⊢ execProofList ([] ++ L₂) p = execProofList L₂ (execProofList [] p) rfl All goals completed! 🐙
| cons s rest ih => cons L₂:List ProofSteps:ProofSteprest:List ProofStepih:∀ (p : ℕ × ℕ), execProofList (rest ++ L₂) p = execProofList L₂ (execProofList rest p)p:ℕ × ℕ⊢ execProofList (s :: rest ++ L₂) p = execProofList L₂ (execProofList (s :: rest) p) exact ih (execProofStep s p) All goals completed! 🐙
By induction on WadeZFProvable φ, every provable formula φ has a non-empty list of proof
steps L that pushes φ onto any initial wff-stack (top, stk).
theorem exists_proofList_of_wadeZFProvable {φ : ℕ} (h : WadeZFProvable φ) :
∃ L : List ProofStep, L ≠ [] ∧
∀ top stk : ℕ, execProofList L (top, stk) = (φ, cantorPair top stk) := by φ:ℕh:WadeZFProvable φ⊢ ∃ L, L ≠ [] ∧ ∀ (top stk : ℕ), execProofList L (top, stk) = (φ, cantorPair top stk)
induction h with
| moot => moot φ:ℕ⊢ ∃ L, L ≠ [] ∧ ∀ (top stk : ℕ), execProofList L (top, stk) = (zfEq 0 0, cantorPair top stk)
exact ⟨[(0, 0, 0, 0)], List.cons_ne_nil _ _, fun _ _ => rfl⟩ All goals completed! 🐙
| @mp φ ψ hφ himp ihφ ihimp => mp φ✝:ℕφ:ℕψ:ℕhφ:WadeZFProvable φhimp:WadeZFProvable (zfImp φ ψ)ihφ:∃ L, L ≠ [] ∧ ∀ (top stk : ℕ), execProofList L (top, stk) = (φ, cantorPair top stk)ihimp:∃ L, L ≠ [] ∧ ∀ (top stk : ℕ), execProofList L (top, stk) = (zfImp φ ψ, cantorPair top stk)⊢ ∃ L, L ≠ [] ∧ ∀ (top stk : ℕ), execProofList L (top, stk) = (ψ, cantorPair top stk)
obtain ⟨L_imp, _, himp_eval⟩ := ihimp mp φ✝:ℕφ:ℕψ:ℕhφ:WadeZFProvable φhimp:WadeZFProvable (zfImp φ ψ)ihφ:∃ L, L ≠ [] ∧ ∀ (top stk : ℕ), execProofList L (top, stk) = (φ, cantorPair top stk)L_imp:List ProofStepleft✝:L_imp ≠ []himp_eval:∀ (top stk : ℕ), execProofList L_imp (top, stk) = (zfImp φ ψ, cantorPair top stk)⊢ ∃ L, L ≠ [] ∧ ∀ (top stk : ℕ), execProofList L (top, stk) = (ψ, cantorPair top stk)
obtain ⟨L_φ, _, hφ_eval⟩ := ihφ mp φ✝:ℕφ:ℕψ:ℕhφ:WadeZFProvable φhimp:WadeZFProvable (zfImp φ ψ)L_imp:List ProofStepleft✝¹:L_imp ≠ []himp_eval:∀ (top stk : ℕ), execProofList L_imp (top, stk) = (zfImp φ ψ, cantorPair top stk)L_φ:List ProofStepleft✝:L_φ ≠ []hφ_eval:∀ (top stk : ℕ), execProofList L_φ (top, stk) = (φ, cantorPair top stk)⊢ ∃ L, L ≠ [] ∧ ∀ (top stk : ℕ), execProofList L (top, stk) = (ψ, cantorPair top stk)
refine ⟨L_imp ++ L_φ ++ [(1, ψ, 0, 0)], by φ✝:ℕφ:ℕψ:ℕhφ:WadeZFProvable φhimp:WadeZFProvable (zfImp φ ψ)L_imp:List ProofStepleft✝¹:L_imp ≠ []himp_eval:∀ (top stk : ℕ), execProofList L_imp (top, stk) = (zfImp φ ψ, cantorPair top stk)L_φ:List ProofStepleft✝:L_φ ≠ []hφ_eval:∀ (top stk : ℕ), execProofList L_φ (top, stk) = (φ, cantorPair top stk)⊢ L_imp ++ L_φ ++ [(1, ψ, 0, 0)] ≠ [] simp All goals completed! 🐙, fun top stk => ?_⟩
rw [execProofList_append, mp φ✝:ℕφ:ℕψ:ℕhφ:WadeZFProvable φhimp:WadeZFProvable (zfImp φ ψ)L_imp:List ProofStepleft✝¹:L_imp ≠ []himp_eval:∀ (top stk : ℕ), execProofList L_imp (top, stk) = (zfImp φ ψ, cantorPair top stk)L_φ:List ProofStepleft✝:L_φ ≠ []hφ_eval:∀ (top stk : ℕ), execProofList L_φ (top, stk) = (φ, cantorPair top stk)top:ℕstk:ℕ⊢ execProofList [(1, ψ, 0, 0)] (execProofList (L_imp ++ L_φ) (top, stk)) = (ψ, cantorPair top stk) execProofList_append, mp φ✝:ℕφ:ℕψ:ℕhφ:WadeZFProvable φhimp:WadeZFProvable (zfImp φ ψ)L_imp:List ProofStepleft✝¹:L_imp ≠ []himp_eval:∀ (top stk : ℕ), execProofList L_imp (top, stk) = (zfImp φ ψ, cantorPair top stk)L_φ:List ProofStepleft✝:L_φ ≠ []hφ_eval:∀ (top stk : ℕ), execProofList L_φ (top, stk) = (φ, cantorPair top stk)top:ℕstk:ℕ⊢ execProofList [(1, ψ, 0, 0)] (execProofList L_φ (execProofList L_imp (top, stk))) = (ψ, cantorPair top stk) himp_eval, mp φ✝:ℕφ:ℕψ:ℕhφ:WadeZFProvable φhimp:WadeZFProvable (zfImp φ ψ)L_imp:List ProofStepleft✝¹:L_imp ≠ []himp_eval:∀ (top stk : ℕ), execProofList L_imp (top, stk) = (zfImp φ ψ, cantorPair top stk)L_φ:List ProofStepleft✝:L_φ ≠ []hφ_eval:∀ (top stk : ℕ), execProofList L_φ (top, stk) = (φ, cantorPair top stk)top:ℕstk:ℕ⊢ execProofList [(1, ψ, 0, 0)] (execProofList L_φ (zfImp φ ψ, cantorPair top stk)) = (ψ, cantorPair top stk) hφ_eval mp φ✝:ℕφ:ℕψ:ℕhφ:WadeZFProvable φhimp:WadeZFProvable (zfImp φ ψ)L_imp:List ProofStepleft✝¹:L_imp ≠ []himp_eval:∀ (top stk : ℕ), execProofList L_imp (top, stk) = (zfImp φ ψ, cantorPair top stk)L_φ:List ProofStepleft✝:L_φ ≠ []hφ_eval:∀ (top stk : ℕ), execProofList L_φ (top, stk) = (φ, cantorPair top stk)top:ℕstk:ℕ⊢ execProofList [(1, ψ, 0, 0)] (φ, cantorPair (zfImp φ ψ) (cantorPair top stk)) = (ψ, cantorPair top stk)] mp φ✝:ℕφ:ℕψ:ℕhφ:WadeZFProvable φhimp:WadeZFProvable (zfImp φ ψ)L_imp:List ProofStepleft✝¹:L_imp ≠ []himp_eval:∀ (top stk : ℕ), execProofList L_imp (top, stk) = (zfImp φ ψ, cantorPair top stk)L_φ:List ProofStepleft✝:L_φ ≠ []hφ_eval:∀ (top stk : ℕ), execProofList L_φ (top, stk) = (φ, cantorPair top stk)top:ℕstk:ℕ⊢ execProofList [(1, ψ, 0, 0)] (φ, cantorPair (zfImp φ ψ) (cantorPair top stk)) = (ψ, cantorPair top stk)
simp [execProofStep, zfClauseDispatch] All goals completed! 🐙
| @gen x φ hφ ihφ => gen φ✝:ℕx:ℕφ:ℕhφ:WadeZFProvable φihφ:∃ L, L ≠ [] ∧ ∀ (top stk : ℕ), execProofList L (top, stk) = (φ, cantorPair top stk)⊢ ∃ L, L ≠ [] ∧ ∀ (top stk : ℕ), execProofList L (top, stk) = (zfAll x φ, cantorPair top stk)
obtain ⟨L_φ, _, hφ_eval⟩ := ihφ gen φ✝:ℕx:ℕφ:ℕhφ:WadeZFProvable φL_φ:List ProofStepleft✝:L_φ ≠ []hφ_eval:∀ (top stk : ℕ), execProofList L_φ (top, stk) = (φ, cantorPair top stk)⊢ ∃ L, L ≠ [] ∧ ∀ (top stk : ℕ), execProofList L (top, stk) = (zfAll x φ, cantorPair top stk)
refine ⟨L_φ ++ [(2, x, 0, 0)], by φ✝:ℕx:ℕφ:ℕhφ:WadeZFProvable φL_φ:List ProofStepleft✝:L_φ ≠ []hφ_eval:∀ (top stk : ℕ), execProofList L_φ (top, stk) = (φ, cantorPair top stk)⊢ L_φ ++ [(2, x, 0, 0)] ≠ [] simp All goals completed! 🐙, fun top stk => ?_⟩
rw [execProofList_append, gen φ✝:ℕx:ℕφ:ℕhφ:WadeZFProvable φL_φ:List ProofStepleft✝:L_φ ≠ []hφ_eval:∀ (top stk : ℕ), execProofList L_φ (top, stk) = (φ, cantorPair top stk)top:ℕstk:ℕ⊢ execProofList [(2, x, 0, 0)] (execProofList L_φ (top, stk)) = (zfAll x φ, cantorPair top stk) hφ_eval gen φ✝:ℕx:ℕφ:ℕhφ:WadeZFProvable φL_φ:List ProofStepleft✝:L_φ ≠ []hφ_eval:∀ (top stk : ℕ), execProofList L_φ (top, stk) = (φ, cantorPair top stk)top:ℕstk:ℕ⊢ execProofList [(2, x, 0, 0)] (φ, cantorPair top stk) = (zfAll x φ, cantorPair top stk)] gen φ✝:ℕx:ℕφ:ℕhφ:WadeZFProvable φL_φ:List ProofStepleft✝:L_φ ≠ []hφ_eval:∀ (top stk : ℕ), execProofList L_φ (top, stk) = (φ, cantorPair top stk)top:ℕstk:ℕ⊢ execProofList [(2, x, 0, 0)] (φ, cantorPair top stk) = (zfAll x φ, cantorPair top stk)
simp [execProofStep, zfClauseDispatch] All goals completed! 🐙
| b1 φ ψ χ => b1 φ✝:ℕφ:ℕψ:ℕχ:ℕ⊢ ∃ L, L ≠ [] ∧ ∀ (top stk : ℕ), execProofList L (top, stk) = (axB1 φ ψ χ, cantorPair top stk)
exact ⟨[(3, φ, ψ, χ)], List.cons_ne_nil _ _, fun _ _ => rfl⟩ All goals completed! 🐙
| b2 φ => b2 φ✝:ℕφ:ℕ⊢ ∃ L, L ≠ [] ∧ ∀ (top stk : ℕ), execProofList L (top, stk) = (axB2 φ, cantorPair top stk)
exact ⟨[(4, φ, 0, 0)], List.cons_ne_nil _ _, fun _ _ => rfl⟩ All goals completed! 🐙
| b3 φ ψ => b3 φ✝:ℕφ:ℕψ:ℕ⊢ ∃ L, L ≠ [] ∧ ∀ (top stk : ℕ), execProofList L (top, stk) = (axB3 φ ψ, cantorPair top stk)
exact ⟨[(5, φ, ψ, 0)], List.cons_ne_nil _ _, fun _ _ => rfl⟩ All goals completed! 🐙
| b4 x φ ψ => b4 φ✝:ℕx:ℕφ:ℕψ:ℕ⊢ ∃ L, L ≠ [] ∧ ∀ (top stk : ℕ), execProofList L (top, stk) = (axB4 x φ ψ, cantorPair top stk)
exact ⟨[(6, x, φ, ψ)], List.cons_ne_nil _ _, fun _ _ => rfl⟩ All goals completed! 🐙
| b6a_wade x y z hxz hy => b6a_wade φ:ℕx:ℕy:ℕz:ℕhxz:x ≠ zhy:y ≠ 0⊢ ∃ L, L ≠ [] ∧ ∀ (top stk : ℕ), execProofList L (top, stk) = (axB6a x y z, cantorPair top stk)
refine ⟨[(9, x, y, z)], List.cons_ne_nil _ _, fun top stk => ?_⟩ b6a_wade φ:ℕx:ℕy:ℕz:ℕhxz:x ≠ zhy:y ≠ 0top:ℕstk:ℕ⊢ execProofList [(9, x, y, z)] (top, stk) = (axB6a x y z, cantorPair top stk)
have hcond : ¬ (x = z ∨ y = 0) := not_or.mpr ⟨hxz, hy⟩ b6a_wade φ:ℕx:ℕy:ℕz:ℕhxz:x ≠ zhy:y ≠ 0top:ℕstk:ℕhcond:¬(x = z ∨ y = 0)⊢ execProofList [(9, x, y, z)] (top, stk) = (axB6a x y z, cantorPair top stk)
simp [execProofList, execProofStep, zfClauseDispatch, hcond] All goals completed! 🐙
| b6b x y φ => b6b φ✝:ℕx:ℕy:ℕφ:ℕ⊢ ∃ L, L ≠ [] ∧ ∀ (top stk : ℕ), execProofList L (top, stk) = (axB6b x y φ, cantorPair top stk)
exact ⟨[(7, x, y, φ)], List.cons_ne_nil _ _, fun _ _ => rfl⟩ All goals completed! 🐙
| b6c x φ => b6c φ✝:ℕx:ℕφ:ℕ⊢ ∃ L, L ≠ [] ∧ ∀ (top stk : ℕ), execProofList L (top, stk) = (axB6c x φ, cantorPair top stk)
refine ⟨[(11, x, φ, 0)], List.cons_ne_nil _ _, fun top stk => ?_⟩ b6c φ✝:ℕx:ℕφ:ℕtop:ℕstk:ℕ⊢ execProofList [(11, x, φ, 0)] (top, stk) = (axB6c x φ, cantorPair top stk)
simp [execProofList, execProofStep, zfClauseDispatch] All goals completed! 🐙
| b7 x y => b7 φ:ℕx:ℕy:ℕ⊢ ∃ L, L ≠ [] ∧ ∀ (top stk : ℕ), execProofList L (top, stk) = (axB7 x y, cantorPair top stk)
refine ⟨[(12, x, y, 0)], List.cons_ne_nil _ _, fun top stk => ?_⟩ b7 φ:ℕx:ℕy:ℕtop:ℕstk:ℕ⊢ execProofList [(12, x, y, 0)] (top, stk) = (axB7 x y, cantorPair top stk)
simp [execProofList, execProofStep, zfClauseDispatch] All goals completed! 🐙
| b8a_zero x y => b8a_zero φ:ℕx:ℕy:ℕ⊢ ∃ L, L ≠ [] ∧ ∀ (top stk : ℕ), execProofList L (top, stk) = (axB8a x y 0, cantorPair top stk)
refine ⟨[(13, x, y, 0)], List.cons_ne_nil _ _, fun top stk => ?_⟩ b8a_zero φ:ℕx:ℕy:ℕtop:ℕstk:ℕ⊢ execProofList [(13, x, y, 0)] (top, stk) = (axB8a x y 0, cantorPair top stk)
simp [execProofList, execProofStep, zfClauseDispatch] All goals completed! 🐙
| b8b x y z => b8b φ:ℕx:ℕy:ℕz:ℕ⊢ ∃ L, L ≠ [] ∧ ∀ (top stk : ℕ), execProofList L (top, stk) = (axB8b x y z, cantorPair top stk)
exact ⟨[(8, x, y, z)], List.cons_ne_nil _ _, fun _ _ => rfl⟩ All goals completed! 🐙
| b8c_zero x y => b8c_zero φ:ℕx:ℕy:ℕ⊢ ∃ L, L ≠ [] ∧ ∀ (top stk : ℕ), execProofList L (top, stk) = (axB8c x y 0, cantorPair top stk)
refine ⟨[(15, x, y, 0)], List.cons_ne_nil _ _, fun top stk => ?_⟩ b8c_zero φ:ℕx:ℕy:ℕtop:ℕstk:ℕ⊢ execProofList [(15, x, y, 0)] (top, stk) = (axB8c x y 0, cantorPair top stk)
simp [execProofList, execProofStep, zfClauseDispatch] All goals completed! 🐙
| ext => ext φ:ℕ⊢ ∃ L, L ≠ [] ∧ ∀ (top stk : ℕ), execProofList L (top, stk) = (axExt, cantorPair top stk)
exact ⟨[(16, 0, 0, 0)], List.cons_ne_nil _ _, fun _ _ => rfl⟩ All goals completed! 🐙
| rep φ => rep φ✝:ℕφ:ℕ⊢ ∃ L, L ≠ [] ∧ ∀ (top stk : ℕ), execProofList L (top, stk) = (axRep φ, cantorPair top stk)
refine ⟨[(17, φ, 0, 0)], List.cons_ne_nil _ _, fun top stk => ?_⟩ rep φ✝:ℕφ:ℕtop:ℕstk:ℕ⊢ execProofList [(17, φ, 0, 0)] (top, stk) = (axRep φ, cantorPair top stk)
simp [execProofList, execProofStep, zfClauseDispatch] All goals completed! 🐙
| pow => pow φ:ℕ⊢ ∃ L, L ≠ [] ∧ ∀ (top stk : ℕ), execProofList L (top, stk) = (axPow, cantorPair top stk)
exact ⟨[(18, 0, 0, 0)], List.cons_ne_nil _ _, fun _ _ => rfl⟩ All goals completed! 🐙
| uni => uni φ:ℕ⊢ ∃ L, L ≠ [] ∧ ∀ (top stk : ℕ), execProofList L (top, stk) = (axUni, cantorPair top stk)
exact ⟨[(19, 0, 0, 0)], List.cons_ne_nil _ _, fun _ _ => rfl⟩ All goals completed! 🐙
| inf => inf φ:ℕ⊢ ∃ L, L ≠ [] ∧ ∀ (top stk : ℕ), execProofList L (top, stk) = (axInf, cantorPair top stk)
exact ⟨[(20, 0, 0, 0)], List.cons_ne_nil _ _, fun _ _ => rfl⟩ All goals completed! 🐙
Pack a single ProofStep and continuation rest : ℕ into a prooflist value.
def packProofStep (s : ProofStep) (rest : ℕ) : ℕ :=
cantorPair s.1 (cantorPair s.2.1 (cantorPair s.2.2.1 (cantorPair s.2.2.2 rest))) + 1
Encode a list of ProofSteps into a single natural number for prooflist.
def encodeProofList : List ProofStep → ℕ
| [] => 0
| s :: rest => packProofStep s (encodeProofList rest)@[simp]
theorem encodeProofList_nil : encodeProofList [] = 0 := rfl@[simp]
theorem encodeProofList_cons (s : ProofStep) (rest : List ProofStep) :
encodeProofList (s :: rest) = packProofStep s (encodeProofList rest) := rfltheorem zfMainNext_packProofStep (s : ProofStep) (rest np top stk : ℕ) :
zfMainNext ⟨packProofStep s rest, np, top, stk⟩ =
⟨rest, np, (execProofStep s (top, stk)).1, (execProofStep s (top, stk)).2⟩ := by s:ProofSteprest:ℕnp:ℕtop:ℕstk:ℕ⊢ zfMainNext { prooflist := packProofStep s rest, nextproof := np, topwff := top, wffstack := stk } =
{ prooflist := rest, nextproof := np, topwff := (execProofStep s (top, stk)).1,
wffstack := (execProofStep s (top, stk)).2 }
unfold zfMainNext s:ProofSteprest:ℕnp:ℕtop:ℕstk:ℕ⊢ (have prooflist₁ :=
if { prooflist := packProofStep s rest, nextproof := np, topwff := top, wffstack := stk }.prooflist = 0 then
{ prooflist := packProofStep s rest, nextproof := np, topwff := top, wffstack := stk }.nextproof
else { prooflist := packProofStep s rest, nextproof := np, topwff := top, wffstack := stk }.prooflist - 1;
have nextproof' :=
if { prooflist := packProofStep s rest, nextproof := np, topwff := top, wffstack := stk }.prooflist = 0 then
{ prooflist := packProofStep s rest, nextproof := np, topwff := top, wffstack := stk }.nextproof + 1
else { prooflist := packProofStep s rest, nextproof := np, topwff := top, wffstack := stk }.nextproof;
have u1 := cantorUnpair prooflist₁;
have ac := u1.1;
have u2 := cantorUnpair u1.2;
have p1 := u2.1;
have u3 := cantorUnpair u2.2;
have p2 := u3.1;
have u4 := cantorUnpair u3.2;
have p3 := u4.1;
have prooflist' := u4.2;
have res :=
zfClauseDispatch { prooflist := packProofStep s rest, nextproof := np, topwff := top, wffstack := stk }.topwff
{ prooflist := packProofStep s rest, nextproof := np, topwff := top, wffstack := stk }.wffstack ac p1 p2 p3;
{ prooflist := prooflist', nextproof := nextproof', topwff := res.1, wffstack := res.2 }) =
{ prooflist := rest, nextproof := np, topwff := (execProofStep s (top, stk)).1,
wffstack := (execProofStep s (top, stk)).2 }
simp [packProofStep, execProofStep] All goals completed! 🐙theorem zfMainNext_zero_prooflist (P top stk : ℕ) :
zfMainNext ⟨0, P, top, stk⟩ = zfMainNext ⟨P + 1, P + 1, top, stk⟩ := by P:ℕtop:ℕstk:ℕ⊢ zfMainNext { prooflist := 0, nextproof := P, topwff := top, wffstack := stk } =
zfMainNext { prooflist := P + 1, nextproof := P + 1, topwff := top, wffstack := stk }
unfold zfMainNext P:ℕtop:ℕstk:ℕ⊢ (have prooflist₁ :=
if { prooflist := 0, nextproof := P, topwff := top, wffstack := stk }.prooflist = 0 then
{ prooflist := 0, nextproof := P, topwff := top, wffstack := stk }.nextproof
else { prooflist := 0, nextproof := P, topwff := top, wffstack := stk }.prooflist - 1;
have nextproof' :=
if { prooflist := 0, nextproof := P, topwff := top, wffstack := stk }.prooflist = 0 then
{ prooflist := 0, nextproof := P, topwff := top, wffstack := stk }.nextproof + 1
else { prooflist := 0, nextproof := P, topwff := top, wffstack := stk }.nextproof;
have u1 := cantorUnpair prooflist₁;
have ac := u1.1;
have u2 := cantorUnpair u1.2;
have p1 := u2.1;
have u3 := cantorUnpair u2.2;
have p2 := u3.1;
have u4 := cantorUnpair u3.2;
have p3 := u4.1;
have prooflist' := u4.2;
have res :=
zfClauseDispatch { prooflist := 0, nextproof := P, topwff := top, wffstack := stk }.topwff
{ prooflist := 0, nextproof := P, topwff := top, wffstack := stk }.wffstack ac p1 p2 p3;
{ prooflist := prooflist', nextproof := nextproof', topwff := res.1, wffstack := res.2 }) =
have prooflist₁ :=
if { prooflist := P + 1, nextproof := P + 1, topwff := top, wffstack := stk }.prooflist = 0 then
{ prooflist := P + 1, nextproof := P + 1, topwff := top, wffstack := stk }.nextproof
else { prooflist := P + 1, nextproof := P + 1, topwff := top, wffstack := stk }.prooflist - 1;
have nextproof' :=
if { prooflist := P + 1, nextproof := P + 1, topwff := top, wffstack := stk }.prooflist = 0 then
{ prooflist := P + 1, nextproof := P + 1, topwff := top, wffstack := stk }.nextproof + 1
else { prooflist := P + 1, nextproof := P + 1, topwff := top, wffstack := stk }.nextproof;
have u1 := cantorUnpair prooflist₁;
have ac := u1.1;
have u2 := cantorUnpair u1.2;
have p1 := u2.1;
have u3 := cantorUnpair u2.2;
have p2 := u3.1;
have u4 := cantorUnpair u3.2;
have p3 := u4.1;
have prooflist' := u4.2;
have res :=
zfClauseDispatch { prooflist := P + 1, nextproof := P + 1, topwff := top, wffstack := stk }.topwff
{ prooflist := P + 1, nextproof := P + 1, topwff := top, wffstack := stk }.wffstack ac p1 p2 p3;
{ prooflist := prooflist', nextproof := nextproof', topwff := res.1, wffstack := res.2 }
simp All goals completed! 🐙theorem zfMainNext_prooflist_lt {c : ZfMainCfg} (hpos : 0 < c.prooflist) :
(zfMainNext c).prooflist < c.prooflist ∧ (zfMainNext c).nextproof = c.nextproof := by c:ZfMainCfghpos:0 < c.prooflist⊢ (zfMainNext c).prooflist < c.prooflist ∧ (zfMainNext c).nextproof = c.nextproof
have hne : c.prooflist ≠ 0 := by omega c:ZfMainCfghpos:0 < c.prooflisthne:c.prooflist ≠ 0⊢ (zfMainNext c).prooflist < c.prooflist ∧ (zfMainNext c).nextproof = c.nextproof
simp only [zfMainNext, hne, ↓reduceIte] c:ZfMainCfghpos:0 < c.prooflisthne:c.prooflist ≠ 0⊢ (cantorUnpair (cantorUnpair (cantorUnpair (cantorUnpair (c.prooflist - 1)).2).2).2).2 < c.prooflist ∧ True
have h1 := cantorUnpair_snd_le (c.prooflist - 1) c:ZfMainCfghpos:0 < c.prooflisthne:c.prooflist ≠ 0h1:(cantorUnpair (c.prooflist - 1)).2 ≤ c.prooflist - 1⊢ (cantorUnpair (cantorUnpair (cantorUnpair (cantorUnpair (c.prooflist - 1)).2).2).2).2 < c.prooflist ∧ True
have h2 := cantorUnpair_snd_le (cantorUnpair (c.prooflist - 1)).2 c:ZfMainCfghpos:0 < c.prooflisthne:c.prooflist ≠ 0h1:(cantorUnpair (c.prooflist - 1)).2 ≤ c.prooflist - 1h2:(cantorUnpair (cantorUnpair (c.prooflist - 1)).2).2 ≤ (cantorUnpair (c.prooflist - 1)).2⊢ (cantorUnpair (cantorUnpair (cantorUnpair (cantorUnpair (c.prooflist - 1)).2).2).2).2 < c.prooflist ∧ True
have h3 := cantorUnpair_snd_le (cantorUnpair (cantorUnpair (c.prooflist - 1)).2).2 c:ZfMainCfghpos:0 < c.prooflisthne:c.prooflist ≠ 0h1:(cantorUnpair (c.prooflist - 1)).2 ≤ c.prooflist - 1h2:(cantorUnpair (cantorUnpair (c.prooflist - 1)).2).2 ≤ (cantorUnpair (c.prooflist - 1)).2h3:(cantorUnpair (cantorUnpair (cantorUnpair (c.prooflist - 1)).2).2).2 ≤
(cantorUnpair (cantorUnpair (c.prooflist - 1)).2).2⊢ (cantorUnpair (cantorUnpair (cantorUnpair (cantorUnpair (c.prooflist - 1)).2).2).2).2 < c.prooflist ∧ True
have h4 :=
cantorUnpair_snd_le (cantorUnpair (cantorUnpair (cantorUnpair (c.prooflist - 1)).2).2).2 c:ZfMainCfghpos:0 < c.prooflisthne:c.prooflist ≠ 0h1:(cantorUnpair (c.prooflist - 1)).2 ≤ c.prooflist - 1h2:(cantorUnpair (cantorUnpair (c.prooflist - 1)).2).2 ≤ (cantorUnpair (c.prooflist - 1)).2h3:(cantorUnpair (cantorUnpair (cantorUnpair (c.prooflist - 1)).2).2).2 ≤
(cantorUnpair (cantorUnpair (c.prooflist - 1)).2).2h4:(cantorUnpair (cantorUnpair (cantorUnpair (cantorUnpair (c.prooflist - 1)).2).2).2).2 ≤
(cantorUnpair (cantorUnpair (cantorUnpair (c.prooflist - 1)).2).2).2⊢ (cantorUnpair (cantorUnpair (cantorUnpair (cantorUnpair (c.prooflist - 1)).2).2).2).2 < c.prooflist ∧ True
exact ⟨by c:ZfMainCfghpos:0 < c.prooflisthne:c.prooflist ≠ 0h1:(cantorUnpair (c.prooflist - 1)).2 ≤ c.prooflist - 1h2:(cantorUnpair (cantorUnpair (c.prooflist - 1)).2).2 ≤ (cantorUnpair (c.prooflist - 1)).2h3:(cantorUnpair (cantorUnpair (cantorUnpair (c.prooflist - 1)).2).2).2 ≤
(cantorUnpair (cantorUnpair (c.prooflist - 1)).2).2h4:(cantorUnpair (cantorUnpair (cantorUnpair (cantorUnpair (c.prooflist - 1)).2).2).2).2 ≤
(cantorUnpair (cantorUnpair (cantorUnpair (c.prooflist - 1)).2).2).2⊢ (cantorUnpair (cantorUnpair (cantorUnpair (cantorUnpair (c.prooflist - 1)).2).2).2).2 < c.prooflist omega All goals completed! 🐙, trivial⟩
If MainLoopHalts is false, then zfMainStep never halts on any configuration reachable
from zfMainInit.
private theorem step_some_of_not_halts {n : ℕ} {c : ZfMainCfg}
(hNotHalts : ¬ MainLoopHalts) (hn : zfMainNSteps n zfMainInit = some c) :
zfMainStep c = some (zfMainNext c) := by n:ℕc:ZfMainCfghNotHalts:¬MainLoopHaltshn:zfMainNSteps n zfMainInit = some c⊢ zfMainStep c = some (zfMainNext c)
rcases hs : zfMainStep c with _ | c' none n:ℕc:ZfMainCfghNotHalts:¬MainLoopHaltshn:zfMainNSteps n zfMainInit = some chs:zfMainStep c = none⊢ none = some (zfMainNext c)some n:ℕc:ZfMainCfghNotHalts:¬MainLoopHaltshn:zfMainNSteps n zfMainInit = some cc':ZfMainCfghs:zfMainStep c = some c'⊢ some c' = some (zfMainNext c)
· none n:ℕc:ZfMainCfghNotHalts:¬MainLoopHaltshn:zfMainNSteps n zfMainInit = some chs:zfMainStep c = none⊢ none = some (zfMainNext c) exfalso none n:ℕc:ZfMainCfghNotHalts:¬MainLoopHaltshn:zfMainNSteps n zfMainInit = some chs:zfMainStep c = none⊢ False
exact hNotHalts (mainLoopHalts_iff_exists_zfMainNSteps.mpr ⟨n, c, hn, hs⟩) All goals completed! 🐙
· some n:ℕc:ZfMainCfghNotHalts:¬MainLoopHaltshn:zfMainNSteps n zfMainInit = some cc':ZfMainCfghs:zfMainStep c = some c'⊢ some c' = some (zfMainNext c) unfold zfMainStep at hs some n:ℕc:ZfMainCfghNotHalts:¬MainLoopHaltshn:zfMainNSteps n zfMainInit = some cc':ZfMainCfghs:(if (zfMainNext c).topwff = 1 then none else some (zfMainNext c)) = some c'⊢ some c' = some (zfMainNext c)
split_ifs at hs with h1 neg n:ℕc:ZfMainCfghNotHalts:¬MainLoopHaltshn:zfMainNSteps n zfMainInit = some cc':ZfMainCfgh1:¬(zfMainNext c).topwff = 1hs:some (zfMainNext c) = some c'⊢ some c' = some (zfMainNext c)
exact hs.symm All goals completed! 🐙
Under ¬ MainLoopHalts, any reachable configuration c eventually drains c.prooflist to 0
without changing c.nextproof.
private theorem drain_prooflist_of_not_halts (hNotHalts : ¬ MainLoopHalts) (pl : ℕ) :
∀ {n : ℕ} {c : ZfMainCfg},
zfMainNSteps n zfMainInit = some c →
c.prooflist = pl →
∃ m c',
zfMainNSteps m zfMainInit = some c' ∧ c'.prooflist = 0 ∧ c'.nextproof = c.nextproof := by hNotHalts:¬MainLoopHaltspl:ℕ⊢ ∀ {n : ℕ} {c : ZfMainCfg},
zfMainNSteps n zfMainInit = some c →
c.prooflist = pl → ∃ m c', zfMainNSteps m zfMainInit = some c' ∧ c'.prooflist = 0 ∧ c'.nextproof = c.nextproof
induction pl using Nat.strong_induction_on with
| h pl ih => h hNotHalts:¬MainLoopHaltspl:ℕih:∀ m < pl,
∀ {n : ℕ} {c : ZfMainCfg},
zfMainNSteps n zfMainInit = some c →
c.prooflist = m → ∃ m c', zfMainNSteps m zfMainInit = some c' ∧ c'.prooflist = 0 ∧ c'.nextproof = c.nextproof⊢ ∀ {n : ℕ} {c : ZfMainCfg},
zfMainNSteps n zfMainInit = some c →
c.prooflist = pl → ∃ m c', zfMainNSteps m zfMainInit = some c' ∧ c'.prooflist = 0 ∧ c'.nextproof = c.nextproof
intro n c hn hpl h hNotHalts:¬MainLoopHaltspl:ℕih:∀ m < pl,
∀ {n : ℕ} {c : ZfMainCfg},
zfMainNSteps n zfMainInit = some c →
c.prooflist = m → ∃ m c', zfMainNSteps m zfMainInit = some c' ∧ c'.prooflist = 0 ∧ c'.nextproof = c.nextproofn:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some chpl:c.prooflist = pl⊢ ∃ m c', zfMainNSteps m zfMainInit = some c' ∧ c'.prooflist = 0 ∧ c'.nextproof = c.nextproof
by_cases hzero : pl = 0 pos hNotHalts:¬MainLoopHaltspl:ℕih:∀ m < pl,
∀ {n : ℕ} {c : ZfMainCfg},
zfMainNSteps n zfMainInit = some c →
c.prooflist = m → ∃ m c', zfMainNSteps m zfMainInit = some c' ∧ c'.prooflist = 0 ∧ c'.nextproof = c.nextproofn:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some chpl:c.prooflist = plhzero:pl = 0⊢ ∃ m c', zfMainNSteps m zfMainInit = some c' ∧ c'.prooflist = 0 ∧ c'.nextproof = c.nextproofneg hNotHalts:¬MainLoopHaltspl:ℕih:∀ m < pl,
∀ {n : ℕ} {c : ZfMainCfg},
zfMainNSteps n zfMainInit = some c →
c.prooflist = m → ∃ m c', zfMainNSteps m zfMainInit = some c' ∧ c'.prooflist = 0 ∧ c'.nextproof = c.nextproofn:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some chpl:c.prooflist = plhzero:¬pl = 0⊢ ∃ m c', zfMainNSteps m zfMainInit = some c' ∧ c'.prooflist = 0 ∧ c'.nextproof = c.nextproof
· pos hNotHalts:¬MainLoopHaltspl:ℕih:∀ m < pl,
∀ {n : ℕ} {c : ZfMainCfg},
zfMainNSteps n zfMainInit = some c →
c.prooflist = m → ∃ m c', zfMainNSteps m zfMainInit = some c' ∧ c'.prooflist = 0 ∧ c'.nextproof = c.nextproofn:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some chpl:c.prooflist = plhzero:pl = 0⊢ ∃ m c', zfMainNSteps m zfMainInit = some c' ∧ c'.prooflist = 0 ∧ c'.nextproof = c.nextproof exact ⟨n, c, hn, hpl.trans hzero, rfl⟩ All goals completed! 🐙
· neg hNotHalts:¬MainLoopHaltspl:ℕih:∀ m < pl,
∀ {n : ℕ} {c : ZfMainCfg},
zfMainNSteps n zfMainInit = some c →
c.prooflist = m → ∃ m c', zfMainNSteps m zfMainInit = some c' ∧ c'.prooflist = 0 ∧ c'.nextproof = c.nextproofn:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some chpl:c.prooflist = plhzero:¬pl = 0⊢ ∃ m c', zfMainNSteps m zfMainInit = some c' ∧ c'.prooflist = 0 ∧ c'.nextproof = c.nextproof have hpos : 0 < c.prooflist := by hNotHalts:¬MainLoopHaltspl:ℕ⊢ ∀ {n : ℕ} {c : ZfMainCfg},
zfMainNSteps n zfMainInit = some c →
c.prooflist = pl → ∃ m c', zfMainNSteps m zfMainInit = some c' ∧ c'.prooflist = 0 ∧ c'.nextproof = c.nextproof omega neg hNotHalts:¬MainLoopHaltspl:ℕih:∀ m < pl,
∀ {n : ℕ} {c : ZfMainCfg},
zfMainNSteps n zfMainInit = some c →
c.prooflist = m → ∃ m c', zfMainNSteps m zfMainInit = some c' ∧ c'.prooflist = 0 ∧ c'.nextproof = c.nextproofn:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some chpl:c.prooflist = plhzero:¬pl = 0hpos:0 < c.prooflist⊢ ∃ m c', zfMainNSteps m zfMainInit = some c' ∧ c'.prooflist = 0 ∧ c'.nextproof = c.nextproof
have hstep : zfMainStep c = some (zfMainNext c) := step_some_of_not_halts hNotHalts hn neg hNotHalts:¬MainLoopHaltspl:ℕih:∀ m < pl,
∀ {n : ℕ} {c : ZfMainCfg},
zfMainNSteps n zfMainInit = some c →
c.prooflist = m → ∃ m c', zfMainNSteps m zfMainInit = some c' ∧ c'.prooflist = 0 ∧ c'.nextproof = c.nextproofn:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some chpl:c.prooflist = plhzero:¬pl = 0hpos:0 < c.prooflisthstep:zfMainStep c = some (zfMainNext c)⊢ ∃ m c', zfMainNSteps m zfMainInit = some c' ∧ c'.prooflist = 0 ∧ c'.nextproof = c.nextproof
have hn1 : zfMainNSteps (n + 1) zfMainInit = some (zfMainNext c) :=
zfMainNSteps_bind_eq hn (by hNotHalts:¬MainLoopHaltspl:ℕih:∀ m < pl,
∀ {n : ℕ} {c : ZfMainCfg},
zfMainNSteps n zfMainInit = some c →
c.prooflist = m → ∃ m c', zfMainNSteps m zfMainInit = some c' ∧ c'.prooflist = 0 ∧ c'.nextproof = c.nextproofn:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some chpl:c.prooflist = plhzero:¬pl = 0hpos:0 < c.prooflisthstep:zfMainStep c = some (zfMainNext c)⊢ zfMainNSteps 1 c = some (zfMainNext c) simp [zfMainNSteps, hstep] All goals completed! 🐙) neg hNotHalts:¬MainLoopHaltspl:ℕih:∀ m < pl,
∀ {n : ℕ} {c : ZfMainCfg},
zfMainNSteps n zfMainInit = some c →
c.prooflist = m → ∃ m c', zfMainNSteps m zfMainInit = some c' ∧ c'.prooflist = 0 ∧ c'.nextproof = c.nextproofn:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some chpl:c.prooflist = plhzero:¬pl = 0hpos:0 < c.prooflisthstep:zfMainStep c = some (zfMainNext c)hn1:zfMainNSteps (n + 1) zfMainInit = some (zfMainNext c)⊢ ∃ m c', zfMainNSteps m zfMainInit = some c' ∧ c'.prooflist = 0 ∧ c'.nextproof = c.nextproof
obtain ⟨hlt, hnp⟩ := zfMainNext_prooflist_lt hpos neg hNotHalts:¬MainLoopHaltspl:ℕih:∀ m < pl,
∀ {n : ℕ} {c : ZfMainCfg},
zfMainNSteps n zfMainInit = some c →
c.prooflist = m → ∃ m c', zfMainNSteps m zfMainInit = some c' ∧ c'.prooflist = 0 ∧ c'.nextproof = c.nextproofn:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some chpl:c.prooflist = plhzero:¬pl = 0hpos:0 < c.prooflisthstep:zfMainStep c = some (zfMainNext c)hn1:zfMainNSteps (n + 1) zfMainInit = some (zfMainNext c)hlt:(zfMainNext c).prooflist < c.prooflisthnp:(zfMainNext c).nextproof = c.nextproof⊢ ∃ m c', zfMainNSteps m zfMainInit = some c' ∧ c'.prooflist = 0 ∧ c'.nextproof = c.nextproof
rw [hpl neg hNotHalts:¬MainLoopHaltspl:ℕih:∀ m < pl,
∀ {n : ℕ} {c : ZfMainCfg},
zfMainNSteps n zfMainInit = some c →
c.prooflist = m → ∃ m c', zfMainNSteps m zfMainInit = some c' ∧ c'.prooflist = 0 ∧ c'.nextproof = c.nextproofn:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some chpl:c.prooflist = plhzero:¬pl = 0hpos:0 < c.prooflisthstep:zfMainStep c = some (zfMainNext c)hn1:zfMainNSteps (n + 1) zfMainInit = some (zfMainNext c)hlt:(zfMainNext c).prooflist < plhnp:(zfMainNext c).nextproof = c.nextproof⊢ ∃ m c', zfMainNSteps m zfMainInit = some c' ∧ c'.prooflist = 0 ∧ c'.nextproof = c.nextproof] at hlt neg hNotHalts:¬MainLoopHaltspl:ℕih:∀ m < pl,
∀ {n : ℕ} {c : ZfMainCfg},
zfMainNSteps n zfMainInit = some c →
c.prooflist = m → ∃ m c', zfMainNSteps m zfMainInit = some c' ∧ c'.prooflist = 0 ∧ c'.nextproof = c.nextproofn:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some chpl:c.prooflist = plhzero:¬pl = 0hpos:0 < c.prooflisthstep:zfMainStep c = some (zfMainNext c)hn1:zfMainNSteps (n + 1) zfMainInit = some (zfMainNext c)hlt:(zfMainNext c).prooflist < plhnp:(zfMainNext c).nextproof = c.nextproof⊢ ∃ m c', zfMainNSteps m zfMainInit = some c' ∧ c'.prooflist = 0 ∧ c'.nextproof = c.nextproof
obtain ⟨m, c', hm, hpl', hnp'⟩ := ih (zfMainNext c).prooflist hlt hn1 rfl neg hNotHalts:¬MainLoopHaltspl:ℕih:∀ m < pl,
∀ {n : ℕ} {c : ZfMainCfg},
zfMainNSteps n zfMainInit = some c →
c.prooflist = m → ∃ m c', zfMainNSteps m zfMainInit = some c' ∧ c'.prooflist = 0 ∧ c'.nextproof = c.nextproofn:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some chpl:c.prooflist = plhzero:¬pl = 0hpos:0 < c.prooflisthstep:zfMainStep c = some (zfMainNext c)hn1:zfMainNSteps (n + 1) zfMainInit = some (zfMainNext c)hlt:(zfMainNext c).prooflist < plhnp:(zfMainNext c).nextproof = c.nextproofm:ℕc':ZfMainCfghm:zfMainNSteps m zfMainInit = some c'hpl':c'.prooflist = 0hnp':c'.nextproof = (zfMainNext c).nextproof⊢ ∃ m c', zfMainNSteps m zfMainInit = some c' ∧ c'.prooflist = 0 ∧ c'.nextproof = c.nextproof
exact ⟨m, c', hm, hpl', hnp'.trans hnp⟩ All goals completed! 🐙
Under ¬ MainLoopHalts, for every N : ℕ, the machine eventually reaches a configuration c
with c.prooflist = 0 and c.nextproof = N.
private theorem reaches_nextproof_of_not_halts (hNotHalts : ¬ MainLoopHalts) (N : ℕ) :
∃ n c, zfMainNSteps n zfMainInit = some c ∧ c.prooflist = 0 ∧ c.nextproof = N := by hNotHalts:¬MainLoopHaltsN:ℕ⊢ ∃ n c, zfMainNSteps n zfMainInit = some c ∧ c.prooflist = 0 ∧ c.nextproof = N
induction N with
| zero => zero hNotHalts:¬MainLoopHalts⊢ ∃ n c, zfMainNSteps n zfMainInit = some c ∧ c.prooflist = 0 ∧ c.nextproof = 0 exact ⟨0, zfMainInit, rfl, rfl, rfl⟩ All goals completed! 🐙
| succ N ih => succ hNotHalts:¬MainLoopHaltsN:ℕih:∃ n c, zfMainNSteps n zfMainInit = some c ∧ c.prooflist = 0 ∧ c.nextproof = N⊢ ∃ n c, zfMainNSteps n zfMainInit = some c ∧ c.prooflist = 0 ∧ c.nextproof = N + 1
obtain ⟨n, c, hn, hpl0, hnp⟩ := ih succ hNotHalts:¬MainLoopHaltsN:ℕn:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some chpl0:c.prooflist = 0hnp:c.nextproof = N⊢ ∃ n c, zfMainNSteps n zfMainInit = some c ∧ c.prooflist = 0 ∧ c.nextproof = N + 1
have hstep : zfMainStep c = some (zfMainNext c) := step_some_of_not_halts hNotHalts hn succ hNotHalts:¬MainLoopHaltsN:ℕn:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some chpl0:c.prooflist = 0hnp:c.nextproof = Nhstep:zfMainStep c = some (zfMainNext c)⊢ ∃ n c, zfMainNSteps n zfMainInit = some c ∧ c.prooflist = 0 ∧ c.nextproof = N + 1
have hn1 : zfMainNSteps (n + 1) zfMainInit = some (zfMainNext c) :=
zfMainNSteps_bind_eq hn (by hNotHalts:¬MainLoopHaltsN:ℕn:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some chpl0:c.prooflist = 0hnp:c.nextproof = Nhstep:zfMainStep c = some (zfMainNext c)⊢ zfMainNSteps 1 c = some (zfMainNext c) simp [zfMainNSteps, hstep] All goals completed! 🐙) succ hNotHalts:¬MainLoopHaltsN:ℕn:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some chpl0:c.prooflist = 0hnp:c.nextproof = Nhstep:zfMainStep c = some (zfMainNext c)hn1:zfMainNSteps (n + 1) zfMainInit = some (zfMainNext c)⊢ ∃ n c, zfMainNSteps n zfMainInit = some c ∧ c.prooflist = 0 ∧ c.nextproof = N + 1
have hnp_next : (zfMainNext c).nextproof = N + 1 := by hNotHalts:¬MainLoopHaltsN:ℕ⊢ ∃ n c, zfMainNSteps n zfMainInit = some c ∧ c.prooflist = 0 ∧ c.nextproof = N
unfold zfMainNext hNotHalts:¬MainLoopHaltsN:ℕn:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some chpl0:c.prooflist = 0hnp:c.nextproof = Nhstep:zfMainStep c = some (zfMainNext c)hn1:zfMainNSteps (n + 1) zfMainInit = some (zfMainNext c)⊢ (have prooflist₁ := if c.prooflist = 0 then c.nextproof else c.prooflist - 1;
have nextproof' := if c.prooflist = 0 then c.nextproof + 1 else c.nextproof;
have u1 := cantorUnpair prooflist₁;
have ac := u1.1;
have u2 := cantorUnpair u1.2;
have p1 := u2.1;
have u3 := cantorUnpair u2.2;
have p2 := u3.1;
have u4 := cantorUnpair u3.2;
have p3 := u4.1;
have prooflist' := u4.2;
have res := zfClauseDispatch c.topwff c.wffstack ac p1 p2 p3;
{ prooflist := prooflist', nextproof := nextproof', topwff := res.1, wffstack := res.2 }).nextproof =
N + 1
simp [hpl0, hnp] succ hNotHalts:¬MainLoopHaltsN:ℕn:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some chpl0:c.prooflist = 0hnp:c.nextproof = Nhstep:zfMainStep c = some (zfMainNext c)hn1:zfMainNSteps (n + 1) zfMainInit = some (zfMainNext c)hnp_next:(zfMainNext c).nextproof = N + 1⊢ ∃ n c, zfMainNSteps n zfMainInit = some c ∧ c.prooflist = 0 ∧ c.nextproof = N + 1
obtain ⟨m, c', hm, hpl', hnp'⟩ :=
drain_prooflist_of_not_halts hNotHalts (zfMainNext c).prooflist hn1 rfl succ hNotHalts:¬MainLoopHaltsN:ℕn:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some chpl0:c.prooflist = 0hnp:c.nextproof = Nhstep:zfMainStep c = some (zfMainNext c)hn1:zfMainNSteps (n + 1) zfMainInit = some (zfMainNext c)hnp_next:(zfMainNext c).nextproof = N + 1m:ℕc':ZfMainCfghm:zfMainNSteps m zfMainInit = some c'hpl':c'.prooflist = 0hnp':c'.nextproof = (zfMainNext c).nextproof⊢ ∃ n c, zfMainNSteps n zfMainInit = some c ∧ c.prooflist = 0 ∧ c.nextproof = N + 1
exact ⟨m, c', hm, hpl', hnp'.trans hnp_next⟩ All goals completed! 🐙
Under ¬ MainLoopHalts, executing encodeProofList L from a reachable configuration evaluates
execProofList L on (topwff, wffstack).
private theorem exec_encodeProofList_of_not_halts (hNotHalts : ¬ MainLoopHalts)
(L : List ProofStep) :
∀ {n : ℕ} {np top stk : ℕ},
zfMainNSteps n zfMainInit = some ⟨encodeProofList L, np, top, stk⟩ →
zfMainNSteps (n + L.length) zfMainInit =
some ⟨0, np, (execProofList L (top, stk)).1, (execProofList L (top, stk)).2⟩ := by hNotHalts:¬MainLoopHaltsL:List ProofStep⊢ ∀ {n np top stk : ℕ},
zfMainNSteps n zfMainInit = some { prooflist := encodeProofList L, nextproof := np, topwff := top, wffstack := stk } →
zfMainNSteps (n + L.length) zfMainInit =
some
{ prooflist := 0, nextproof := np, topwff := (execProofList L (top, stk)).1,
wffstack := (execProofList L (top, stk)).2 }
induction L with
| nil => nil hNotHalts:¬MainLoopHalts⊢ ∀ {n np top stk : ℕ},
zfMainNSteps n zfMainInit =
some { prooflist := encodeProofList [], nextproof := np, topwff := top, wffstack := stk } →
zfMainNSteps (n + [].length) zfMainInit =
some
{ prooflist := 0, nextproof := np, topwff := (execProofList [] (top, stk)).1,
wffstack := (execProofList [] (top, stk)).2 }
intro n np top stk hn nil hNotHalts:¬MainLoopHaltsn:ℕnp:ℕtop:ℕstk:ℕhn:zfMainNSteps n zfMainInit = some { prooflist := encodeProofList [], nextproof := np, topwff := top, wffstack := stk }⊢ zfMainNSteps (n + [].length) zfMainInit =
some
{ prooflist := 0, nextproof := np, topwff := (execProofList [] (top, stk)).1,
wffstack := (execProofList [] (top, stk)).2 }
simpa using hn All goals completed! 🐙
| cons s rest ih => cons hNotHalts:¬MainLoopHaltss:ProofSteprest:List ProofStepih:∀ {n np top stk : ℕ},
zfMainNSteps n zfMainInit =
some { prooflist := encodeProofList rest, nextproof := np, topwff := top, wffstack := stk } →
zfMainNSteps (n + rest.length) zfMainInit =
some
{ prooflist := 0, nextproof := np, topwff := (execProofList rest (top, stk)).1,
wffstack := (execProofList rest (top, stk)).2 }⊢ ∀ {n np top stk : ℕ},
zfMainNSteps n zfMainInit =
some { prooflist := encodeProofList (s :: rest), nextproof := np, topwff := top, wffstack := stk } →
zfMainNSteps (n + (s :: rest).length) zfMainInit =
some
{ prooflist := 0, nextproof := np, topwff := (execProofList (s :: rest) (top, stk)).1,
wffstack := (execProofList (s :: rest) (top, stk)).2 }
intro n np top stk hn cons hNotHalts:¬MainLoopHaltss:ProofSteprest:List ProofStepih:∀ {n np top stk : ℕ},
zfMainNSteps n zfMainInit =
some { prooflist := encodeProofList rest, nextproof := np, topwff := top, wffstack := stk } →
zfMainNSteps (n + rest.length) zfMainInit =
some
{ prooflist := 0, nextproof := np, topwff := (execProofList rest (top, stk)).1,
wffstack := (execProofList rest (top, stk)).2 }n:ℕnp:ℕtop:ℕstk:ℕhn:zfMainNSteps n zfMainInit =
some { prooflist := encodeProofList (s :: rest), nextproof := np, topwff := top, wffstack := stk }⊢ zfMainNSteps (n + (s :: rest).length) zfMainInit =
some
{ prooflist := 0, nextproof := np, topwff := (execProofList (s :: rest) (top, stk)).1,
wffstack := (execProofList (s :: rest) (top, stk)).2 }
have hstep : zfMainStep ⟨encodeProofList (s :: rest), np, top, stk⟩ =
some (zfMainNext ⟨encodeProofList (s :: rest), np, top, stk⟩) :=
step_some_of_not_halts hNotHalts hn cons hNotHalts:¬MainLoopHaltss:ProofSteprest:List ProofStepih:∀ {n np top stk : ℕ},
zfMainNSteps n zfMainInit =
some { prooflist := encodeProofList rest, nextproof := np, topwff := top, wffstack := stk } →
zfMainNSteps (n + rest.length) zfMainInit =
some
{ prooflist := 0, nextproof := np, topwff := (execProofList rest (top, stk)).1,
wffstack := (execProofList rest (top, stk)).2 }n:ℕnp:ℕtop:ℕstk:ℕhn:zfMainNSteps n zfMainInit =
some { prooflist := encodeProofList (s :: rest), nextproof := np, topwff := top, wffstack := stk }hstep:zfMainStep { prooflist := encodeProofList (s :: rest), nextproof := np, topwff := top, wffstack := stk } =
some (zfMainNext { prooflist := encodeProofList (s :: rest), nextproof := np, topwff := top, wffstack := stk })⊢ zfMainNSteps (n + (s :: rest).length) zfMainInit =
some
{ prooflist := 0, nextproof := np, topwff := (execProofList (s :: rest) (top, stk)).1,
wffstack := (execProofList (s :: rest) (top, stk)).2 }
rw [encodeProofList_cons, cons hNotHalts:¬MainLoopHaltss:ProofSteprest:List ProofStepih:∀ {n np top stk : ℕ},
zfMainNSteps n zfMainInit =
some { prooflist := encodeProofList rest, nextproof := np, topwff := top, wffstack := stk } →
zfMainNSteps (n + rest.length) zfMainInit =
some
{ prooflist := 0, nextproof := np, topwff := (execProofList rest (top, stk)).1,
wffstack := (execProofList rest (top, stk)).2 }n:ℕnp:ℕtop:ℕstk:ℕhn:zfMainNSteps n zfMainInit =
some { prooflist := encodeProofList (s :: rest), nextproof := np, topwff := top, wffstack := stk }hstep:zfMainStep { prooflist := packProofStep s (encodeProofList rest), nextproof := np, topwff := top, wffstack := stk } =
some
(zfMainNext
{ prooflist := packProofStep s (encodeProofList rest), nextproof := np, topwff := top, wffstack := stk })⊢ zfMainNSteps (n + (s :: rest).length) zfMainInit =
some
{ prooflist := 0, nextproof := np, topwff := (execProofList (s :: rest) (top, stk)).1,
wffstack := (execProofList (s :: rest) (top, stk)).2 } zfMainNext_packProofStep cons hNotHalts:¬MainLoopHaltss:ProofSteprest:List ProofStepih:∀ {n np top stk : ℕ},
zfMainNSteps n zfMainInit =
some { prooflist := encodeProofList rest, nextproof := np, topwff := top, wffstack := stk } →
zfMainNSteps (n + rest.length) zfMainInit =
some
{ prooflist := 0, nextproof := np, topwff := (execProofList rest (top, stk)).1,
wffstack := (execProofList rest (top, stk)).2 }n:ℕnp:ℕtop:ℕstk:ℕhn:zfMainNSteps n zfMainInit =
some { prooflist := encodeProofList (s :: rest), nextproof := np, topwff := top, wffstack := stk }hstep:zfMainStep { prooflist := packProofStep s (encodeProofList rest), nextproof := np, topwff := top, wffstack := stk } =
some
{ prooflist := encodeProofList rest, nextproof := np, topwff := (execProofStep s (top, stk)).1,
wffstack := (execProofStep s (top, stk)).2 }⊢ zfMainNSteps (n + (s :: rest).length) zfMainInit =
some
{ prooflist := 0, nextproof := np, topwff := (execProofList (s :: rest) (top, stk)).1,
wffstack := (execProofList (s :: rest) (top, stk)).2 }] at hstep cons hNotHalts:¬MainLoopHaltss:ProofSteprest:List ProofStepih:∀ {n np top stk : ℕ},
zfMainNSteps n zfMainInit =
some { prooflist := encodeProofList rest, nextproof := np, topwff := top, wffstack := stk } →
zfMainNSteps (n + rest.length) zfMainInit =
some
{ prooflist := 0, nextproof := np, topwff := (execProofList rest (top, stk)).1,
wffstack := (execProofList rest (top, stk)).2 }n:ℕnp:ℕtop:ℕstk:ℕhn:zfMainNSteps n zfMainInit =
some { prooflist := encodeProofList (s :: rest), nextproof := np, topwff := top, wffstack := stk }hstep:zfMainStep { prooflist := packProofStep s (encodeProofList rest), nextproof := np, topwff := top, wffstack := stk } =
some
{ prooflist := encodeProofList rest, nextproof := np, topwff := (execProofStep s (top, stk)).1,
wffstack := (execProofStep s (top, stk)).2 }⊢ zfMainNSteps (n + (s :: rest).length) zfMainInit =
some
{ prooflist := 0, nextproof := np, topwff := (execProofList (s :: rest) (top, stk)).1,
wffstack := (execProofList (s :: rest) (top, stk)).2 }
have hn1 : zfMainNSteps (n + 1) zfMainInit =
some ⟨encodeProofList rest, np,
(execProofStep s (top, stk)).1, (execProofStep s (top, stk)).2⟩ :=
zfMainNSteps_bind_eq hn (by hNotHalts:¬MainLoopHaltss:ProofSteprest:List ProofStepih:∀ {n np top stk : ℕ},
zfMainNSteps n zfMainInit =
some { prooflist := encodeProofList rest, nextproof := np, topwff := top, wffstack := stk } →
zfMainNSteps (n + rest.length) zfMainInit =
some
{ prooflist := 0, nextproof := np, topwff := (execProofList rest (top, stk)).1,
wffstack := (execProofList rest (top, stk)).2 }n:ℕnp:ℕtop:ℕstk:ℕhn:zfMainNSteps n zfMainInit =
some { prooflist := encodeProofList (s :: rest), nextproof := np, topwff := top, wffstack := stk }hstep:zfMainStep { prooflist := packProofStep s (encodeProofList rest), nextproof := np, topwff := top, wffstack := stk } =
some
{ prooflist := encodeProofList rest, nextproof := np, topwff := (execProofStep s (top, stk)).1,
wffstack := (execProofStep s (top, stk)).2 }⊢ zfMainNSteps 1 { prooflist := encodeProofList (s :: rest), nextproof := np, topwff := top, wffstack := stk } =
some
{ prooflist := encodeProofList rest, nextproof := np, topwff := (execProofStep s (top, stk)).1,
wffstack := (execProofStep s (top, stk)).2 } simp [zfMainNSteps, hstep] All goals completed! 🐙) cons hNotHalts:¬MainLoopHaltss:ProofSteprest:List ProofStepih:∀ {n np top stk : ℕ},
zfMainNSteps n zfMainInit =
some { prooflist := encodeProofList rest, nextproof := np, topwff := top, wffstack := stk } →
zfMainNSteps (n + rest.length) zfMainInit =
some
{ prooflist := 0, nextproof := np, topwff := (execProofList rest (top, stk)).1,
wffstack := (execProofList rest (top, stk)).2 }n:ℕnp:ℕtop:ℕstk:ℕhn:zfMainNSteps n zfMainInit =
some { prooflist := encodeProofList (s :: rest), nextproof := np, topwff := top, wffstack := stk }hstep:zfMainStep { prooflist := packProofStep s (encodeProofList rest), nextproof := np, topwff := top, wffstack := stk } =
some
{ prooflist := encodeProofList rest, nextproof := np, topwff := (execProofStep s (top, stk)).1,
wffstack := (execProofStep s (top, stk)).2 }hn1:zfMainNSteps (n + 1) zfMainInit =
some
{ prooflist := encodeProofList rest, nextproof := np, topwff := (execProofStep s (top, stk)).1,
wffstack := (execProofStep s (top, stk)).2 }⊢ zfMainNSteps (n + (s :: rest).length) zfMainInit =
some
{ prooflist := 0, nextproof := np, topwff := (execProofList (s :: rest) (top, stk)).1,
wffstack := (execProofList (s :: rest) (top, stk)).2 }
have hrest := ih hn1 cons hNotHalts:¬MainLoopHaltss:ProofSteprest:List ProofStepih:∀ {n np top stk : ℕ},
zfMainNSteps n zfMainInit =
some { prooflist := encodeProofList rest, nextproof := np, topwff := top, wffstack := stk } →
zfMainNSteps (n + rest.length) zfMainInit =
some
{ prooflist := 0, nextproof := np, topwff := (execProofList rest (top, stk)).1,
wffstack := (execProofList rest (top, stk)).2 }n:ℕnp:ℕtop:ℕstk:ℕhn:zfMainNSteps n zfMainInit =
some { prooflist := encodeProofList (s :: rest), nextproof := np, topwff := top, wffstack := stk }hstep:zfMainStep { prooflist := packProofStep s (encodeProofList rest), nextproof := np, topwff := top, wffstack := stk } =
some
{ prooflist := encodeProofList rest, nextproof := np, topwff := (execProofStep s (top, stk)).1,
wffstack := (execProofStep s (top, stk)).2 }hn1:zfMainNSteps (n + 1) zfMainInit =
some
{ prooflist := encodeProofList rest, nextproof := np, topwff := (execProofStep s (top, stk)).1,
wffstack := (execProofStep s (top, stk)).2 }hrest:zfMainNSteps (n + 1 + rest.length) zfMainInit =
some
{ prooflist := 0, nextproof := np,
topwff := (execProofList rest ((execProofStep s (top, stk)).1, (execProofStep s (top, stk)).2)).1,
wffstack := (execProofList rest ((execProofStep s (top, stk)).1, (execProofStep s (top, stk)).2)).2 }⊢ zfMainNSteps (n + (s :: rest).length) zfMainInit =
some
{ prooflist := 0, nextproof := np, topwff := (execProofList (s :: rest) (top, stk)).1,
wffstack := (execProofList (s :: rest) (top, stk)).2 }
have hlen : n + 1 + rest.length = n + (s :: rest).length := by hNotHalts:¬MainLoopHaltsL:List ProofStep⊢ ∀ {n np top stk : ℕ},
zfMainNSteps n zfMainInit = some { prooflist := encodeProofList L, nextproof := np, topwff := top, wffstack := stk } →
zfMainNSteps (n + L.length) zfMainInit =
some
{ prooflist := 0, nextproof := np, topwff := (execProofList L (top, stk)).1,
wffstack := (execProofList L (top, stk)).2 } simp hNotHalts:¬MainLoopHaltss:ProofSteprest:List ProofStepih:∀ {n np top stk : ℕ},
zfMainNSteps n zfMainInit =
some { prooflist := encodeProofList rest, nextproof := np, topwff := top, wffstack := stk } →
zfMainNSteps (n + rest.length) zfMainInit =
some
{ prooflist := 0, nextproof := np, topwff := (execProofList rest (top, stk)).1,
wffstack := (execProofList rest (top, stk)).2 }n:ℕnp:ℕtop:ℕstk:ℕhn:zfMainNSteps n zfMainInit =
some { prooflist := encodeProofList (s :: rest), nextproof := np, topwff := top, wffstack := stk }hstep:zfMainStep { prooflist := packProofStep s (encodeProofList rest), nextproof := np, topwff := top, wffstack := stk } =
some
{ prooflist := encodeProofList rest, nextproof := np, topwff := (execProofStep s (top, stk)).1,
wffstack := (execProofStep s (top, stk)).2 }hn1:zfMainNSteps (n + 1) zfMainInit =
some
{ prooflist := encodeProofList rest, nextproof := np, topwff := (execProofStep s (top, stk)).1,
wffstack := (execProofStep s (top, stk)).2 }hrest:zfMainNSteps (n + 1 + rest.length) zfMainInit =
some
{ prooflist := 0, nextproof := np,
topwff := (execProofList rest ((execProofStep s (top, stk)).1, (execProofStep s (top, stk)).2)).1,
wffstack := (execProofList rest ((execProofStep s (top, stk)).1, (execProofStep s (top, stk)).2)).2 }⊢ n + 1 + rest.length = n + (rest.length + 1); omega cons hNotHalts:¬MainLoopHaltss:ProofSteprest:List ProofStepih:∀ {n np top stk : ℕ},
zfMainNSteps n zfMainInit =
some { prooflist := encodeProofList rest, nextproof := np, topwff := top, wffstack := stk } →
zfMainNSteps (n + rest.length) zfMainInit =
some
{ prooflist := 0, nextproof := np, topwff := (execProofList rest (top, stk)).1,
wffstack := (execProofList rest (top, stk)).2 }n:ℕnp:ℕtop:ℕstk:ℕhn:zfMainNSteps n zfMainInit =
some { prooflist := encodeProofList (s :: rest), nextproof := np, topwff := top, wffstack := stk }hstep:zfMainStep { prooflist := packProofStep s (encodeProofList rest), nextproof := np, topwff := top, wffstack := stk } =
some
{ prooflist := encodeProofList rest, nextproof := np, topwff := (execProofStep s (top, stk)).1,
wffstack := (execProofStep s (top, stk)).2 }hn1:zfMainNSteps (n + 1) zfMainInit =
some
{ prooflist := encodeProofList rest, nextproof := np, topwff := (execProofStep s (top, stk)).1,
wffstack := (execProofStep s (top, stk)).2 }hrest:zfMainNSteps (n + 1 + rest.length) zfMainInit =
some
{ prooflist := 0, nextproof := np,
topwff := (execProofList rest ((execProofStep s (top, stk)).1, (execProofStep s (top, stk)).2)).1,
wffstack := (execProofList rest ((execProofStep s (top, stk)).1, (execProofStep s (top, stk)).2)).2 }hlen:n + 1 + rest.length = n + (s :: rest).length⊢ zfMainNSteps (n + (s :: rest).length) zfMainInit =
some
{ prooflist := 0, nextproof := np, topwff := (execProofList (s :: rest) (top, stk)).1,
wffstack := (execProofList (s :: rest) (top, stk)).2 }
rwa [hlen] at hrest All goals completed! 🐙
Completeness of zfMainStep: if WadeZFInconsistent holds, then MainLoopHalts.
theorem mainLoopHalts_of_wadeZFInconsistent (hInc : WadeZFInconsistent) : MainLoopHalts := by hInc:WadeZFInconsistent⊢ MainLoopHalts
by_contra hNotHalts hInc:WadeZFInconsistenthNotHalts:¬MainLoopHalts⊢ False
obtain ⟨L, hL_ne, hL_eval⟩ := exists_proofList_of_wadeZFProvable hInc hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltsL:List ProofStephL_ne:L ≠ []hL_eval:∀ (top stk : ℕ), execProofList L (top, stk) = (zfMem 0 0, cantorPair top stk)⊢ False
let s₀ : ProofStep := (0, 0, 0, 0) hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltsL:List ProofStephL_ne:L ≠ []hL_eval:∀ (top stk : ℕ), execProofList L (top, stk) = (zfMem 0 0, cantorPair top stk)s₀:ProofStep := (0, 0, 0, 0)⊢ False
let P : ℕ := encodeProofList (s₀ :: L) - 1 hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltsL:List ProofStephL_ne:L ≠ []hL_eval:∀ (top stk : ℕ), execProofList L (top, stk) = (zfMem 0 0, cantorPair top stk)s₀:ProofStep := (0, 0, 0, 0)P:ℕ := encodeProofList (s₀ :: L) - 1⊢ False
have hP_succ : P + 1 = packProofStep s₀ (encodeProofList L) := by hInc:WadeZFInconsistent⊢ MainLoopHalts
simp only [P, encodeProofList_cons, packProofStep] hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltsL:List ProofStephL_ne:L ≠ []hL_eval:∀ (top stk : ℕ), execProofList L (top, stk) = (zfMem 0 0, cantorPair top stk)s₀:ProofStep := (0, 0, 0, 0)P:ℕ := encodeProofList (s₀ :: L) - 1⊢ cantorPair s₀.1 (cantorPair s₀.2.1 (cantorPair s₀.2.2.1 (cantorPair s₀.2.2.2 (encodeProofList L)))) + 1 - 1 + 1 =
cantorPair s₀.1 (cantorPair s₀.2.1 (cantorPair s₀.2.2.1 (cantorPair s₀.2.2.2 (encodeProofList L)))) + 1; omega hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltsL:List ProofStephL_ne:L ≠ []hL_eval:∀ (top stk : ℕ), execProofList L (top, stk) = (zfMem 0 0, cantorPair top stk)s₀:ProofStep := (0, 0, 0, 0)P:ℕ := encodeProofList (s₀ :: L) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList L)⊢ False
obtain ⟨n, c, hn, hpl0, hnp⟩ := reaches_nextproof_of_not_halts hNotHalts P hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltsL:List ProofStephL_ne:L ≠ []hL_eval:∀ (top stk : ℕ), execProofList L (top, stk) = (zfMem 0 0, cantorPair top stk)s₀:ProofStep := (0, 0, 0, 0)P:ℕ := encodeProofList (s₀ :: L) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList L)n:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some chpl0:c.prooflist = 0hnp:c.nextproof = P⊢ False
have hc_eq : c = ⟨0, P, c.topwff, c.wffstack⟩ := by hInc:WadeZFInconsistent⊢ MainLoopHalts
cases c mk hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltsL:List ProofStephL_ne:L ≠ []hL_eval:∀ (top stk : ℕ), execProofList L (top, stk) = (zfMem 0 0, cantorPair top stk)s₀:ProofStep := (0, 0, 0, 0)P:ℕ := encodeProofList (s₀ :: L) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList L)n:ℕprooflist✝:ℕnextproof✝:ℕtopwff✝:ℕwffstack✝:ℕhn:zfMainNSteps n zfMainInit =
some { prooflist := prooflist✝, nextproof := nextproof✝, topwff := topwff✝, wffstack := wffstack✝ }hpl0:{ prooflist := prooflist✝, nextproof := nextproof✝, topwff := topwff✝, wffstack := wffstack✝ }.prooflist = 0hnp:{ prooflist := prooflist✝, nextproof := nextproof✝, topwff := topwff✝, wffstack := wffstack✝ }.nextproof = P⊢ { prooflist := prooflist✝, nextproof := nextproof✝, topwff := topwff✝, wffstack := wffstack✝ } =
{ prooflist := 0, nextproof := P,
topwff := { prooflist := prooflist✝, nextproof := nextproof✝, topwff := topwff✝, wffstack := wffstack✝ }.topwff,
wffstack :=
{ prooflist := prooflist✝, nextproof := nextproof✝, topwff := topwff✝, wffstack := wffstack✝ }.wffstack }
dsimp at hpl0 hnp mk hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltsL:List ProofStephL_ne:L ≠ []hL_eval:∀ (top stk : ℕ), execProofList L (top, stk) = (zfMem 0 0, cantorPair top stk)s₀:ProofStep := (0, 0, 0, 0)P:ℕ := encodeProofList (s₀ :: L) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList L)n:ℕprooflist✝:ℕnextproof✝:ℕtopwff✝:ℕwffstack✝:ℕhn:zfMainNSteps n zfMainInit =
some { prooflist := prooflist✝, nextproof := nextproof✝, topwff := topwff✝, wffstack := wffstack✝ }hpl0:prooflist✝ = 0hnp:nextproof✝ = P⊢ { prooflist := prooflist✝, nextproof := nextproof✝, topwff := topwff✝, wffstack := wffstack✝ } =
{ prooflist := 0, nextproof := P,
topwff := { prooflist := prooflist✝, nextproof := nextproof✝, topwff := topwff✝, wffstack := wffstack✝ }.topwff,
wffstack :=
{ prooflist := prooflist✝, nextproof := nextproof✝, topwff := topwff✝, wffstack := wffstack✝ }.wffstack }
subst hpl0 hnp mk hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltsL:List ProofStephL_ne:L ≠ []hL_eval:∀ (top stk : ℕ), execProofList L (top, stk) = (zfMem 0 0, cantorPair top stk)s₀:ProofStep := (0, 0, 0, 0)P:ℕ := encodeProofList (s₀ :: L) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList L)n:ℕtopwff✝:ℕwffstack✝:ℕhn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := topwff✝, wffstack := wffstack✝ }⊢ { prooflist := 0, nextproof := P, topwff := topwff✝, wffstack := wffstack✝ } =
{ prooflist := 0, nextproof := P,
topwff := { prooflist := 0, nextproof := P, topwff := topwff✝, wffstack := wffstack✝ }.topwff,
wffstack := { prooflist := 0, nextproof := P, topwff := topwff✝, wffstack := wffstack✝ }.wffstack }
rfl hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltsL:List ProofStephL_ne:L ≠ []hL_eval:∀ (top stk : ℕ), execProofList L (top, stk) = (zfMem 0 0, cantorPair top stk)s₀:ProofStep := (0, 0, 0, 0)P:ℕ := encodeProofList (s₀ :: L) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList L)n:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some chpl0:c.prooflist = 0hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }⊢ False
rw [hc_eq hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltsL:List ProofStephL_ne:L ≠ []hL_eval:∀ (top stk : ℕ), execProofList L (top, stk) = (zfMem 0 0, cantorPair top stk)s₀:ProofStep := (0, 0, 0, 0)P:ℕ := encodeProofList (s₀ :: L) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList L)n:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hpl0:c.prooflist = 0hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }⊢ False] at hn hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltsL:List ProofStephL_ne:L ≠ []hL_eval:∀ (top stk : ℕ), execProofList L (top, stk) = (zfMem 0 0, cantorPair top stk)s₀:ProofStep := (0, 0, 0, 0)P:ℕ := encodeProofList (s₀ :: L) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList L)n:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hpl0:c.prooflist = 0hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }⊢ False
have hstep0 : zfMainStep ⟨0, P, c.topwff, c.wffstack⟩ =
some (zfMainNext ⟨0, P, c.topwff, c.wffstack⟩) :=
step_some_of_not_halts hNotHalts hn hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltsL:List ProofStephL_ne:L ≠ []hL_eval:∀ (top stk : ℕ), execProofList L (top, stk) = (zfMem 0 0, cantorPair top stk)s₀:ProofStep := (0, 0, 0, 0)P:ℕ := encodeProofList (s₀ :: L) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList L)n:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hpl0:c.prooflist = 0hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some (zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack })⊢ False
have hnext0 : zfMainNext ⟨0, P, c.topwff, c.wffstack⟩ =
⟨encodeProofList L, P + 1, (execProofStep s₀ (c.topwff, c.wffstack)).1,
(execProofStep s₀ (c.topwff, c.wffstack)).2⟩ := by hInc:WadeZFInconsistent⊢ MainLoopHalts
rw [zfMainNext_zero_prooflist, hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltsL:List ProofStephL_ne:L ≠ []hL_eval:∀ (top stk : ℕ), execProofList L (top, stk) = (zfMem 0 0, cantorPair top stk)s₀:ProofStep := (0, 0, 0, 0)P:ℕ := encodeProofList (s₀ :: L) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList L)n:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hpl0:c.prooflist = 0hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some (zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack })⊢ zfMainNext { prooflist := P + 1, nextproof := P + 1, topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList L, nextproof := P + 1, topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1,
wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 } hP_succ hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltsL:List ProofStephL_ne:L ≠ []hL_eval:∀ (top stk : ℕ), execProofList L (top, stk) = (zfMem 0 0, cantorPair top stk)s₀:ProofStep := (0, 0, 0, 0)P:ℕ := encodeProofList (s₀ :: L) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList L)n:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hpl0:c.prooflist = 0hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some (zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack })⊢ zfMainNext
{ prooflist := packProofStep s₀ (encodeProofList L), nextproof := packProofStep s₀ (encodeProofList L),
topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList L, nextproof := packProofStep s₀ (encodeProofList L),
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }] hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltsL:List ProofStephL_ne:L ≠ []hL_eval:∀ (top stk : ℕ), execProofList L (top, stk) = (zfMem 0 0, cantorPair top stk)s₀:ProofStep := (0, 0, 0, 0)P:ℕ := encodeProofList (s₀ :: L) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList L)n:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hpl0:c.prooflist = 0hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some (zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack })⊢ zfMainNext
{ prooflist := packProofStep s₀ (encodeProofList L), nextproof := packProofStep s₀ (encodeProofList L),
topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList L, nextproof := packProofStep s₀ (encodeProofList L),
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }
exact zfMainNext_packProofStep s₀ (encodeProofList L) (P + 1) c.topwff c.wffstack hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltsL:List ProofStephL_ne:L ≠ []hL_eval:∀ (top stk : ℕ), execProofList L (top, stk) = (zfMem 0 0, cantorPair top stk)s₀:ProofStep := (0, 0, 0, 0)P:ℕ := encodeProofList (s₀ :: L) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList L)n:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hpl0:c.prooflist = 0hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some (zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack })hnext0:zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList L, nextproof := P + 1, topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1,
wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }⊢ False
rw [hnext0 hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltsL:List ProofStephL_ne:L ≠ []hL_eval:∀ (top stk : ℕ), execProofList L (top, stk) = (zfMem 0 0, cantorPair top stk)s₀:ProofStep := (0, 0, 0, 0)P:ℕ := encodeProofList (s₀ :: L) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList L)n:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hpl0:c.prooflist = 0hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some
{ prooflist := encodeProofList L, nextproof := P + 1, topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1,
wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hnext0:zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList L, nextproof := P + 1, topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1,
wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }⊢ False] at hstep0 hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltsL:List ProofStephL_ne:L ≠ []hL_eval:∀ (top stk : ℕ), execProofList L (top, stk) = (zfMem 0 0, cantorPair top stk)s₀:ProofStep := (0, 0, 0, 0)P:ℕ := encodeProofList (s₀ :: L) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList L)n:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hpl0:c.prooflist = 0hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some
{ prooflist := encodeProofList L, nextproof := P + 1, topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1,
wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hnext0:zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList L, nextproof := P + 1, topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1,
wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }⊢ False
have hn1 : zfMainNSteps (n + 1) zfMainInit =
some ⟨encodeProofList L, P + 1, (execProofStep s₀ (c.topwff, c.wffstack)).1,
(execProofStep s₀ (c.topwff, c.wffstack)).2⟩ :=
zfMainNSteps_bind_eq hn (by hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltsL:List ProofStephL_ne:L ≠ []hL_eval:∀ (top stk : ℕ), execProofList L (top, stk) = (zfMem 0 0, cantorPair top stk)s₀:ProofStep := (0, 0, 0, 0)P:ℕ := encodeProofList (s₀ :: L) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList L)n:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hpl0:c.prooflist = 0hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some
{ prooflist := encodeProofList L, nextproof := P + 1, topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1,
wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hnext0:zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList L, nextproof := P + 1, topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1,
wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }⊢ zfMainNSteps 1 { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some
{ prooflist := encodeProofList L, nextproof := P + 1, topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1,
wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 } simp [zfMainNSteps, hstep0] All goals completed! 🐙) hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltsL:List ProofStephL_ne:L ≠ []hL_eval:∀ (top stk : ℕ), execProofList L (top, stk) = (zfMem 0 0, cantorPair top stk)s₀:ProofStep := (0, 0, 0, 0)P:ℕ := encodeProofList (s₀ :: L) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList L)n:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hpl0:c.prooflist = 0hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some
{ prooflist := encodeProofList L, nextproof := P + 1, topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1,
wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hnext0:zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList L, nextproof := P + 1, topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1,
wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn1:zfMainNSteps (n + 1) zfMainInit =
some
{ prooflist := encodeProofList L, nextproof := P + 1, topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1,
wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }⊢ False
have hL_ne_nil : ∃ LInit sLast, L = LInit ++ [sLast] := by hInc:WadeZFInconsistent⊢ MainLoopHalts
refine ⟨L.dropLast, L.getLast hL_ne, (List.dropLast_append_getLast hL_ne).symm⟩ hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltsL:List ProofStephL_ne:L ≠ []hL_eval:∀ (top stk : ℕ), execProofList L (top, stk) = (zfMem 0 0, cantorPair top stk)s₀:ProofStep := (0, 0, 0, 0)P:ℕ := encodeProofList (s₀ :: L) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList L)n:ℕc:ZfMainCfghn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hpl0:c.prooflist = 0hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some
{ prooflist := encodeProofList L, nextproof := P + 1, topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1,
wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hnext0:zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList L, nextproof := P + 1, topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1,
wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn1:zfMainNSteps (n + 1) zfMainInit =
some
{ prooflist := encodeProofList L, nextproof := P + 1, topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1,
wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hL_ne_nil:∃ LInit sLast, L = LInit ++ [sLast]⊢ False
obtain ⟨LInit, sLast, rfl⟩ := hL_ne_nil hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltss₀:ProofStep := (0, 0, 0, 0)n:ℕc:ZfMainCfghpl0:c.prooflist = 0LInit:List ProofStepsLast:ProofStephL_ne:LInit ++ [sLast] ≠ []hL_eval:∀ (top stk : ℕ), execProofList (LInit ++ [sLast]) (top, stk) = (zfMem 0 0, cantorPair top stk)P:ℕ := encodeProofList (s₀ :: (LInit ++ [sLast])) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList (LInit ++ [sLast]))hn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hnext0:zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn1:zfMainNSteps (n + 1) zfMainInit =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }⊢ False
have hn_all := exec_encodeProofList_of_not_halts hNotHalts (LInit ++ [sLast]) hn1 hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltss₀:ProofStep := (0, 0, 0, 0)n:ℕc:ZfMainCfghpl0:c.prooflist = 0LInit:List ProofStepsLast:ProofStephL_ne:LInit ++ [sLast] ≠ []hL_eval:∀ (top stk : ℕ), execProofList (LInit ++ [sLast]) (top, stk) = (zfMem 0 0, cantorPair top stk)P:ℕ := encodeProofList (s₀ :: (LInit ++ [sLast])) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList (LInit ++ [sLast]))hn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hnext0:zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn1:zfMainNSteps (n + 1) zfMainInit =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn_all:zfMainNSteps (n + 1 + (LInit ++ [sLast]).length) zfMainInit =
some
{ prooflist := 0, nextproof := P + 1,
topwff :=
(execProofList (LInit ++ [sLast])
((execProofStep s₀ (c.topwff, c.wffstack)).1, (execProofStep s₀ (c.topwff, c.wffstack)).2)).1,
wffstack :=
(execProofList (LInit ++ [sLast])
((execProofStep s₀ (c.topwff, c.wffstack)).1, (execProofStep s₀ (c.topwff, c.wffstack)).2)).2 }⊢ False
rw [hL_eval hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltss₀:ProofStep := (0, 0, 0, 0)n:ℕc:ZfMainCfghpl0:c.prooflist = 0LInit:List ProofStepsLast:ProofStephL_ne:LInit ++ [sLast] ≠ []hL_eval:∀ (top stk : ℕ), execProofList (LInit ++ [sLast]) (top, stk) = (zfMem 0 0, cantorPair top stk)P:ℕ := encodeProofList (s₀ :: (LInit ++ [sLast])) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList (LInit ++ [sLast]))hn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hnext0:zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn1:zfMainNSteps (n + 1) zfMainInit =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn_all:zfMainNSteps (n + 1 + (LInit ++ [sLast]).length) zfMainInit =
some
{ prooflist := 0, nextproof := P + 1,
topwff :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).1,
wffstack :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).2 }⊢ False] at hn_all hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltss₀:ProofStep := (0, 0, 0, 0)n:ℕc:ZfMainCfghpl0:c.prooflist = 0LInit:List ProofStepsLast:ProofStephL_ne:LInit ++ [sLast] ≠ []hL_eval:∀ (top stk : ℕ), execProofList (LInit ++ [sLast]) (top, stk) = (zfMem 0 0, cantorPair top stk)P:ℕ := encodeProofList (s₀ :: (LInit ++ [sLast])) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList (LInit ++ [sLast]))hn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hnext0:zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn1:zfMainNSteps (n + 1) zfMainInit =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn_all:zfMainNSteps (n + 1 + (LInit ++ [sLast]).length) zfMainInit =
some
{ prooflist := 0, nextproof := P + 1,
topwff :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).1,
wffstack :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).2 }⊢ False
have hlen_split : n + 1 + (LInit ++ [sLast]).length = (n + 1 + LInit.length) + 1 := by hInc:WadeZFInconsistent⊢ MainLoopHalts
simp hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltss₀:ProofStep := (0, 0, 0, 0)n:ℕc:ZfMainCfghpl0:c.prooflist = 0LInit:List ProofStepsLast:ProofStephL_ne:LInit ++ [sLast] ≠ []hL_eval:∀ (top stk : ℕ), execProofList (LInit ++ [sLast]) (top, stk) = (zfMem 0 0, cantorPair top stk)P:ℕ := encodeProofList (s₀ :: (LInit ++ [sLast])) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList (LInit ++ [sLast]))hn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hnext0:zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn1:zfMainNSteps (n + 1) zfMainInit =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn_all:zfMainNSteps (n + 1 + (LInit ++ [sLast]).length) zfMainInit =
some
{ prooflist := 0, nextproof := P + 1,
topwff :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).1,
wffstack :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).2 }⊢ n + 1 + (LInit.length + 1) = n + 1 + LInit.length + 1; omega hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltss₀:ProofStep := (0, 0, 0, 0)n:ℕc:ZfMainCfghpl0:c.prooflist = 0LInit:List ProofStepsLast:ProofStephL_ne:LInit ++ [sLast] ≠ []hL_eval:∀ (top stk : ℕ), execProofList (LInit ++ [sLast]) (top, stk) = (zfMem 0 0, cantorPair top stk)P:ℕ := encodeProofList (s₀ :: (LInit ++ [sLast])) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList (LInit ++ [sLast]))hn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hnext0:zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn1:zfMainNSteps (n + 1) zfMainInit =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn_all:zfMainNSteps (n + 1 + (LInit ++ [sLast]).length) zfMainInit =
some
{ prooflist := 0, nextproof := P + 1,
topwff :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).1,
wffstack :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).2 }hlen_split:n + 1 + (LInit ++ [sLast]).length = n + 1 + LInit.length + 1⊢ False
rw [hlen_split, hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltss₀:ProofStep := (0, 0, 0, 0)n:ℕc:ZfMainCfghpl0:c.prooflist = 0LInit:List ProofStepsLast:ProofStephL_ne:LInit ++ [sLast] ≠ []hL_eval:∀ (top stk : ℕ), execProofList (LInit ++ [sLast]) (top, stk) = (zfMem 0 0, cantorPair top stk)P:ℕ := encodeProofList (s₀ :: (LInit ++ [sLast])) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList (LInit ++ [sLast]))hn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hnext0:zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn1:zfMainNSteps (n + 1) zfMainInit =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn_all:zfMainNSteps (n + 1 + LInit.length + 1) zfMainInit =
some
{ prooflist := 0, nextproof := P + 1,
topwff :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).1,
wffstack :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).2 }hlen_split:n + 1 + (LInit ++ [sLast]).length = n + 1 + LInit.length + 1⊢ False zfMainNSteps_add hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltss₀:ProofStep := (0, 0, 0, 0)n:ℕc:ZfMainCfghpl0:c.prooflist = 0LInit:List ProofStepsLast:ProofStephL_ne:LInit ++ [sLast] ≠ []hL_eval:∀ (top stk : ℕ), execProofList (LInit ++ [sLast]) (top, stk) = (zfMem 0 0, cantorPair top stk)P:ℕ := encodeProofList (s₀ :: (LInit ++ [sLast])) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList (LInit ++ [sLast]))hn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hnext0:zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn1:zfMainNSteps (n + 1) zfMainInit =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn_all:(zfMainNSteps (n + 1 + LInit.length) zfMainInit).bind (zfMainNSteps 1) =
some
{ prooflist := 0, nextproof := P + 1,
topwff :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).1,
wffstack :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).2 }hlen_split:n + 1 + (LInit ++ [sLast]).length = n + 1 + LInit.length + 1⊢ False] at hn_all hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltss₀:ProofStep := (0, 0, 0, 0)n:ℕc:ZfMainCfghpl0:c.prooflist = 0LInit:List ProofStepsLast:ProofStephL_ne:LInit ++ [sLast] ≠ []hL_eval:∀ (top stk : ℕ), execProofList (LInit ++ [sLast]) (top, stk) = (zfMem 0 0, cantorPair top stk)P:ℕ := encodeProofList (s₀ :: (LInit ++ [sLast])) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList (LInit ++ [sLast]))hn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hnext0:zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn1:zfMainNSteps (n + 1) zfMainInit =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn_all:(zfMainNSteps (n + 1 + LInit.length) zfMainInit).bind (zfMainNSteps 1) =
some
{ prooflist := 0, nextproof := P + 1,
topwff :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).1,
wffstack :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).2 }hlen_split:n + 1 + (LInit ++ [sLast]).length = n + 1 + LInit.length + 1⊢ False
rcases hmid : zfMainNSteps (n + 1 + LInit.length) zfMainInit with _ | cmid none hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltss₀:ProofStep := (0, 0, 0, 0)n:ℕc:ZfMainCfghpl0:c.prooflist = 0LInit:List ProofStepsLast:ProofStephL_ne:LInit ++ [sLast] ≠ []hL_eval:∀ (top stk : ℕ), execProofList (LInit ++ [sLast]) (top, stk) = (zfMem 0 0, cantorPair top stk)P:ℕ := encodeProofList (s₀ :: (LInit ++ [sLast])) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList (LInit ++ [sLast]))hn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hnext0:zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn1:zfMainNSteps (n + 1) zfMainInit =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn_all:(zfMainNSteps (n + 1 + LInit.length) zfMainInit).bind (zfMainNSteps 1) =
some
{ prooflist := 0, nextproof := P + 1,
topwff :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).1,
wffstack :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).2 }hlen_split:n + 1 + (LInit ++ [sLast]).length = n + 1 + LInit.length + 1hmid:zfMainNSteps (n + 1 + LInit.length) zfMainInit = none⊢ Falsesome hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltss₀:ProofStep := (0, 0, 0, 0)n:ℕc:ZfMainCfghpl0:c.prooflist = 0LInit:List ProofStepsLast:ProofStephL_ne:LInit ++ [sLast] ≠ []hL_eval:∀ (top stk : ℕ), execProofList (LInit ++ [sLast]) (top, stk) = (zfMem 0 0, cantorPair top stk)P:ℕ := encodeProofList (s₀ :: (LInit ++ [sLast])) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList (LInit ++ [sLast]))hn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hnext0:zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn1:zfMainNSteps (n + 1) zfMainInit =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn_all:(zfMainNSteps (n + 1 + LInit.length) zfMainInit).bind (zfMainNSteps 1) =
some
{ prooflist := 0, nextproof := P + 1,
topwff :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).1,
wffstack :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).2 }hlen_split:n + 1 + (LInit ++ [sLast]).length = n + 1 + LInit.length + 1cmid:ZfMainCfghmid:zfMainNSteps (n + 1 + LInit.length) zfMainInit = some cmid⊢ False
· none hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltss₀:ProofStep := (0, 0, 0, 0)n:ℕc:ZfMainCfghpl0:c.prooflist = 0LInit:List ProofStepsLast:ProofStephL_ne:LInit ++ [sLast] ≠ []hL_eval:∀ (top stk : ℕ), execProofList (LInit ++ [sLast]) (top, stk) = (zfMem 0 0, cantorPair top stk)P:ℕ := encodeProofList (s₀ :: (LInit ++ [sLast])) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList (LInit ++ [sLast]))hn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hnext0:zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn1:zfMainNSteps (n + 1) zfMainInit =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn_all:(zfMainNSteps (n + 1 + LInit.length) zfMainInit).bind (zfMainNSteps 1) =
some
{ prooflist := 0, nextproof := P + 1,
topwff :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).1,
wffstack :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).2 }hlen_split:n + 1 + (LInit ++ [sLast]).length = n + 1 + LInit.length + 1hmid:zfMainNSteps (n + 1 + LInit.length) zfMainInit = none⊢ False rw [hmid none hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltss₀:ProofStep := (0, 0, 0, 0)n:ℕc:ZfMainCfghpl0:c.prooflist = 0LInit:List ProofStepsLast:ProofStephL_ne:LInit ++ [sLast] ≠ []hL_eval:∀ (top stk : ℕ), execProofList (LInit ++ [sLast]) (top, stk) = (zfMem 0 0, cantorPair top stk)P:ℕ := encodeProofList (s₀ :: (LInit ++ [sLast])) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList (LInit ++ [sLast]))hn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hnext0:zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn1:zfMainNSteps (n + 1) zfMainInit =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn_all:none.bind (zfMainNSteps 1) =
some
{ prooflist := 0, nextproof := P + 1,
topwff :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).1,
wffstack :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).2 }hlen_split:n + 1 + (LInit ++ [sLast]).length = n + 1 + LInit.length + 1hmid:zfMainNSteps (n + 1 + LInit.length) zfMainInit = none⊢ False] at hn_all none hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltss₀:ProofStep := (0, 0, 0, 0)n:ℕc:ZfMainCfghpl0:c.prooflist = 0LInit:List ProofStepsLast:ProofStephL_ne:LInit ++ [sLast] ≠ []hL_eval:∀ (top stk : ℕ), execProofList (LInit ++ [sLast]) (top, stk) = (zfMem 0 0, cantorPair top stk)P:ℕ := encodeProofList (s₀ :: (LInit ++ [sLast])) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList (LInit ++ [sLast]))hn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hnext0:zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn1:zfMainNSteps (n + 1) zfMainInit =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn_all:none.bind (zfMainNSteps 1) =
some
{ prooflist := 0, nextproof := P + 1,
topwff :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).1,
wffstack :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).2 }hlen_split:n + 1 + (LInit ++ [sLast]).length = n + 1 + LInit.length + 1hmid:zfMainNSteps (n + 1 + LInit.length) zfMainInit = none⊢ False; cases hn_all All goals completed! 🐙
· some hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltss₀:ProofStep := (0, 0, 0, 0)n:ℕc:ZfMainCfghpl0:c.prooflist = 0LInit:List ProofStepsLast:ProofStephL_ne:LInit ++ [sLast] ≠ []hL_eval:∀ (top stk : ℕ), execProofList (LInit ++ [sLast]) (top, stk) = (zfMem 0 0, cantorPair top stk)P:ℕ := encodeProofList (s₀ :: (LInit ++ [sLast])) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList (LInit ++ [sLast]))hn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hnext0:zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn1:zfMainNSteps (n + 1) zfMainInit =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn_all:(zfMainNSteps (n + 1 + LInit.length) zfMainInit).bind (zfMainNSteps 1) =
some
{ prooflist := 0, nextproof := P + 1,
topwff :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).1,
wffstack :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).2 }hlen_split:n + 1 + (LInit ++ [sLast]).length = n + 1 + LInit.length + 1cmid:ZfMainCfghmid:zfMainNSteps (n + 1 + LInit.length) zfMainInit = some cmid⊢ False rw [hmid, some hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltss₀:ProofStep := (0, 0, 0, 0)n:ℕc:ZfMainCfghpl0:c.prooflist = 0LInit:List ProofStepsLast:ProofStephL_ne:LInit ++ [sLast] ≠ []hL_eval:∀ (top stk : ℕ), execProofList (LInit ++ [sLast]) (top, stk) = (zfMem 0 0, cantorPair top stk)P:ℕ := encodeProofList (s₀ :: (LInit ++ [sLast])) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList (LInit ++ [sLast]))hn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hnext0:zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn1:zfMainNSteps (n + 1) zfMainInit =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hlen_split:n + 1 + (LInit ++ [sLast]).length = n + 1 + LInit.length + 1cmid:ZfMainCfghn_all:(some cmid).bind (zfMainNSteps 1) =
some
{ prooflist := 0, nextproof := P + 1,
topwff :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).1,
wffstack :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).2 }hmid:zfMainNSteps (n + 1 + LInit.length) zfMainInit = some cmid⊢ False Option.bind_some, some hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltss₀:ProofStep := (0, 0, 0, 0)n:ℕc:ZfMainCfghpl0:c.prooflist = 0LInit:List ProofStepsLast:ProofStephL_ne:LInit ++ [sLast] ≠ []hL_eval:∀ (top stk : ℕ), execProofList (LInit ++ [sLast]) (top, stk) = (zfMem 0 0, cantorPair top stk)P:ℕ := encodeProofList (s₀ :: (LInit ++ [sLast])) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList (LInit ++ [sLast]))hn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hnext0:zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn1:zfMainNSteps (n + 1) zfMainInit =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hlen_split:n + 1 + (LInit ++ [sLast]).length = n + 1 + LInit.length + 1cmid:ZfMainCfghn_all:zfMainNSteps 1 cmid =
some
{ prooflist := 0, nextproof := P + 1,
topwff :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).1,
wffstack :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).2 }hmid:zfMainNSteps (n + 1 + LInit.length) zfMainInit = some cmid⊢ False zfMainNSteps_succ some hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltss₀:ProofStep := (0, 0, 0, 0)n:ℕc:ZfMainCfghpl0:c.prooflist = 0LInit:List ProofStepsLast:ProofStephL_ne:LInit ++ [sLast] ≠ []hL_eval:∀ (top stk : ℕ), execProofList (LInit ++ [sLast]) (top, stk) = (zfMem 0 0, cantorPair top stk)P:ℕ := encodeProofList (s₀ :: (LInit ++ [sLast])) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList (LInit ++ [sLast]))hn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hnext0:zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn1:zfMainNSteps (n + 1) zfMainInit =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hlen_split:n + 1 + (LInit ++ [sLast]).length = n + 1 + LInit.length + 1cmid:ZfMainCfghn_all:(zfMainStep cmid).bind (zfMainNSteps 0) =
some
{ prooflist := 0, nextproof := P + 1,
topwff :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).1,
wffstack :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).2 }hmid:zfMainNSteps (n + 1 + LInit.length) zfMainInit = some cmid⊢ False] at hn_all some hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltss₀:ProofStep := (0, 0, 0, 0)n:ℕc:ZfMainCfghpl0:c.prooflist = 0LInit:List ProofStepsLast:ProofStephL_ne:LInit ++ [sLast] ≠ []hL_eval:∀ (top stk : ℕ), execProofList (LInit ++ [sLast]) (top, stk) = (zfMem 0 0, cantorPair top stk)P:ℕ := encodeProofList (s₀ :: (LInit ++ [sLast])) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList (LInit ++ [sLast]))hn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hnext0:zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn1:zfMainNSteps (n + 1) zfMainInit =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hlen_split:n + 1 + (LInit ++ [sLast]).length = n + 1 + LInit.length + 1cmid:ZfMainCfghn_all:(zfMainStep cmid).bind (zfMainNSteps 0) =
some
{ prooflist := 0, nextproof := P + 1,
topwff :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).1,
wffstack :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).2 }hmid:zfMainNSteps (n + 1 + LInit.length) zfMainInit = some cmid⊢ False
unfold zfMainStep at hn_all some hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltss₀:ProofStep := (0, 0, 0, 0)n:ℕc:ZfMainCfghpl0:c.prooflist = 0LInit:List ProofStepsLast:ProofStephL_ne:LInit ++ [sLast] ≠ []hL_eval:∀ (top stk : ℕ), execProofList (LInit ++ [sLast]) (top, stk) = (zfMem 0 0, cantorPair top stk)P:ℕ := encodeProofList (s₀ :: (LInit ++ [sLast])) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList (LInit ++ [sLast]))hn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hnext0:zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn1:zfMainNSteps (n + 1) zfMainInit =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hlen_split:n + 1 + (LInit ++ [sLast]).length = n + 1 + LInit.length + 1cmid:ZfMainCfghn_all:(if (zfMainNext cmid).topwff = 1 then none else some (zfMainNext cmid)).bind (zfMainNSteps 0) =
some
{ prooflist := 0, nextproof := P + 1,
topwff :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).1,
wffstack :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).2 }hmid:zfMainNSteps (n + 1 + LInit.length) zfMainInit = some cmid⊢ False
split_ifs at hn_all with h1 pos hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltss₀:ProofStep := (0, 0, 0, 0)n:ℕc:ZfMainCfghpl0:c.prooflist = 0LInit:List ProofStepsLast:ProofStephL_ne:LInit ++ [sLast] ≠ []hL_eval:∀ (top stk : ℕ), execProofList (LInit ++ [sLast]) (top, stk) = (zfMem 0 0, cantorPair top stk)P:ℕ := encodeProofList (s₀ :: (LInit ++ [sLast])) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList (LInit ++ [sLast]))hn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hnext0:zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn1:zfMainNSteps (n + 1) zfMainInit =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hlen_split:n + 1 + (LInit ++ [sLast]).length = n + 1 + LInit.length + 1cmid:ZfMainCfghmid:zfMainNSteps (n + 1 + LInit.length) zfMainInit = some cmidh1:(zfMainNext cmid).topwff = 1hn_all:(none.bind fun a ↦ zfMainNSteps 0 a) =
some
{ prooflist := 0, nextproof := P + 1,
topwff :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).1,
wffstack :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).2 }⊢ Falseneg hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltss₀:ProofStep := (0, 0, 0, 0)n:ℕc:ZfMainCfghpl0:c.prooflist = 0LInit:List ProofStepsLast:ProofStephL_ne:LInit ++ [sLast] ≠ []hL_eval:∀ (top stk : ℕ), execProofList (LInit ++ [sLast]) (top, stk) = (zfMem 0 0, cantorPair top stk)P:ℕ := encodeProofList (s₀ :: (LInit ++ [sLast])) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList (LInit ++ [sLast]))hn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hnext0:zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn1:zfMainNSteps (n + 1) zfMainInit =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hlen_split:n + 1 + (LInit ++ [sLast]).length = n + 1 + LInit.length + 1cmid:ZfMainCfghmid:zfMainNSteps (n + 1 + LInit.length) zfMainInit = some cmidh1:¬(zfMainNext cmid).topwff = 1hn_all:((some (zfMainNext cmid)).bind fun a ↦ zfMainNSteps 0 a) =
some
{ prooflist := 0, nextproof := P + 1,
topwff :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).1,
wffstack :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).2 }⊢ False
· pos hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltss₀:ProofStep := (0, 0, 0, 0)n:ℕc:ZfMainCfghpl0:c.prooflist = 0LInit:List ProofStepsLast:ProofStephL_ne:LInit ++ [sLast] ≠ []hL_eval:∀ (top stk : ℕ), execProofList (LInit ++ [sLast]) (top, stk) = (zfMem 0 0, cantorPair top stk)P:ℕ := encodeProofList (s₀ :: (LInit ++ [sLast])) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList (LInit ++ [sLast]))hn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hnext0:zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn1:zfMainNSteps (n + 1) zfMainInit =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hlen_split:n + 1 + (LInit ++ [sLast]).length = n + 1 + LInit.length + 1cmid:ZfMainCfghmid:zfMainNSteps (n + 1 + LInit.length) zfMainInit = some cmidh1:(zfMainNext cmid).topwff = 1hn_all:(none.bind fun a ↦ zfMainNSteps 0 a) =
some
{ prooflist := 0, nextproof := P + 1,
topwff :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).1,
wffstack :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).2 }⊢ False cases hn_all All goals completed! 🐙
· neg hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltss₀:ProofStep := (0, 0, 0, 0)n:ℕc:ZfMainCfghpl0:c.prooflist = 0LInit:List ProofStepsLast:ProofStephL_ne:LInit ++ [sLast] ≠ []hL_eval:∀ (top stk : ℕ), execProofList (LInit ++ [sLast]) (top, stk) = (zfMem 0 0, cantorPair top stk)P:ℕ := encodeProofList (s₀ :: (LInit ++ [sLast])) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList (LInit ++ [sLast]))hn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hnext0:zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn1:zfMainNSteps (n + 1) zfMainInit =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hlen_split:n + 1 + (LInit ++ [sLast]).length = n + 1 + LInit.length + 1cmid:ZfMainCfghmid:zfMainNSteps (n + 1 + LInit.length) zfMainInit = some cmidh1:¬(zfMainNext cmid).topwff = 1hn_all:((some (zfMainNext cmid)).bind fun a ↦ zfMainNSteps 0 a) =
some
{ prooflist := 0, nextproof := P + 1,
topwff :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).1,
wffstack :=
(zfMem 0 0,
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2).2 }⊢ False simp only [Option.bind_some, zfMainNSteps_zero, Option.some.injEq] at hn_all neg hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltss₀:ProofStep := (0, 0, 0, 0)n:ℕc:ZfMainCfghpl0:c.prooflist = 0LInit:List ProofStepsLast:ProofStephL_ne:LInit ++ [sLast] ≠ []hL_eval:∀ (top stk : ℕ), execProofList (LInit ++ [sLast]) (top, stk) = (zfMem 0 0, cantorPair top stk)P:ℕ := encodeProofList (s₀ :: (LInit ++ [sLast])) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList (LInit ++ [sLast]))hn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hnext0:zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn1:zfMainNSteps (n + 1) zfMainInit =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hlen_split:n + 1 + (LInit ++ [sLast]).length = n + 1 + LInit.length + 1cmid:ZfMainCfghmid:zfMainNSteps (n + 1 + LInit.length) zfMainInit = some cmidh1:¬(zfMainNext cmid).topwff = 1hn_all:zfMainNext cmid =
{ prooflist := 0, nextproof := P + 1, topwff := zfMem 0 0,
wffstack := cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2 }⊢ False
have htop : (zfMainNext cmid).topwff = zfMem 0 0 := by hInc:WadeZFInconsistent⊢ MainLoopHalts rw [hn_all hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltss₀:ProofStep := (0, 0, 0, 0)n:ℕc:ZfMainCfghpl0:c.prooflist = 0LInit:List ProofStepsLast:ProofStephL_ne:LInit ++ [sLast] ≠ []hL_eval:∀ (top stk : ℕ), execProofList (LInit ++ [sLast]) (top, stk) = (zfMem 0 0, cantorPair top stk)P:ℕ := encodeProofList (s₀ :: (LInit ++ [sLast])) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList (LInit ++ [sLast]))hn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hnext0:zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn1:zfMainNSteps (n + 1) zfMainInit =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hlen_split:n + 1 + (LInit ++ [sLast]).length = n + 1 + LInit.length + 1cmid:ZfMainCfghmid:zfMainNSteps (n + 1 + LInit.length) zfMainInit = some cmidh1:¬(zfMainNext cmid).topwff = 1hn_all:zfMainNext cmid =
{ prooflist := 0, nextproof := P + 1, topwff := zfMem 0 0,
wffstack := cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2 }⊢ { prooflist := 0, nextproof := P + 1, topwff := zfMem 0 0,
wffstack :=
cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2 }.topwff =
zfMem 0 0] neg hInc:WadeZFInconsistenthNotHalts:¬MainLoopHaltss₀:ProofStep := (0, 0, 0, 0)n:ℕc:ZfMainCfghpl0:c.prooflist = 0LInit:List ProofStepsLast:ProofStephL_ne:LInit ++ [sLast] ≠ []hL_eval:∀ (top stk : ℕ), execProofList (LInit ++ [sLast]) (top, stk) = (zfMem 0 0, cantorPair top stk)P:ℕ := encodeProofList (s₀ :: (LInit ++ [sLast])) - 1hP_succ:P + 1 = packProofStep s₀ (encodeProofList (LInit ++ [sLast]))hn:zfMainNSteps n zfMainInit = some { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hnp:c.nextproof = Phc_eq:c = { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack }hstep0:zfMainStep { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hnext0:zfMainNext { prooflist := 0, nextproof := P, topwff := c.topwff, wffstack := c.wffstack } =
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hn1:zfMainNSteps (n + 1) zfMainInit =
some
{ prooflist := encodeProofList (LInit ++ [sLast]), nextproof := P + 1,
topwff := (execProofStep s₀ (c.topwff, c.wffstack)).1, wffstack := (execProofStep s₀ (c.topwff, c.wffstack)).2 }hlen_split:n + 1 + (LInit ++ [sLast]).length = n + 1 + LInit.length + 1cmid:ZfMainCfghmid:zfMainNSteps (n + 1 + LInit.length) zfMainInit = some cmidh1:¬(zfMainNext cmid).topwff = 1hn_all:zfMainNext cmid =
{ prooflist := 0, nextproof := P + 1, topwff := zfMem 0 0,
wffstack := cantorPair (execProofStep s₀ (c.topwff, c.wffstack)).1 (execProofStep s₀ (c.topwff, c.wffstack)).2 }htop:(zfMainNext cmid).topwff = zfMem 0 0⊢ False
exact h1 htop All goals completed! 🐙
Main Theorem of Layer 3: the zf_432_wade.tm main loop halts if and only if the
20-clause Hilbert system WadeZFProvable is inconsistent (WadeZFInconsistent).
theorem mainLoopHalts_iff_wadeZFInconsistent :
MainLoopHalts ↔ WadeZFInconsistent :=
⟨wadeZFInconsistent_of_mainLoopHalts, mainLoopHalts_of_wadeZFInconsistent⟩
Section 6: 11-Register Bank Subroutine Verification (zf_432_wade.tm)
Register indices of the 11 registers in zf_432_wade.tm.
abbrev regProoflist : ℕ := 0abbrev regNextproof : ℕ := 1abbrev regTopwff : ℕ := 2abbrev regWffstack : ℕ := 3abbrev regAxiomcode : ℕ := 4abbrev regParam1 : ℕ := 5abbrev regParam2 : ℕ := 6abbrev regParam3 : ℕ := 7abbrev regScratch1 : ℕ := 8abbrev regScratch2 : ℕ := 9abbrev regScratch3 : ℕ := 10
Project the 4 persistent registers (prooflist, nextproof, topwff, wffstack) from an
11-register bank regs : List ℕ.
def regsToMainCfg (regs : List ℕ) : ZfMainCfg :=
⟨regs.getD 0 0, regs.getD 1 0, regs.getD 2 0, regs.getD 3 0⟩
Embed a ZfMainCfg into the canonical 11-register bank with zeroed temporary registers
4..10.
def mainCfgToRegs (c : ZfMainCfg) : List ℕ :=
[c.prooflist, c.nextproof, c.topwff, c.wffstack, 0, 0, 0, 0, 0, 0, 0]@[simp]
theorem mainCfgToRegs_length (c : ZfMainCfg) : (mainCfgToRegs c).length = 11 := rfl@[simp]
theorem regsToMainCfg_mainCfgToRegs (c : ZfMainCfg) :
regsToMainCfg (mainCfgToRegs c) = c := by c:ZfMainCfg⊢ regsToMainCfg (mainCfgToRegs c) = c
cases c mk prooflist✝:ℕnextproof✝:ℕtopwff✝:ℕwffstack✝:ℕ⊢ regsToMainCfg
(mainCfgToRegs { prooflist := prooflist✝, nextproof := nextproof✝, topwff := topwff✝, wffstack := wffstack✝ }) =
{ prooflist := prooflist✝, nextproof := nextproof✝, topwff := topwff✝, wffstack := wffstack✝ }; rfl All goals completed! 🐙@[simp]
theorem regsToMainCfg_init :
regsToMainCfg (List.replicate 11 0) = zfMainInit := rfl
Functional specification of pair(out, in1, in2) on an 11-register bank regs : List ℕ.
def regPairOp (out r1 r2 : ℕ) (regs : List ℕ) : List ℕ :=
let v1 := regs.getD r1 0
let v2 := regs.getD r2 0
let vout := regs.getD out 0
((regs.set r1 0).set r2 0).set out (pairLoop vout v1 v2)theorem regPairOp_eq_cantorPair (out r1 r2 : ℕ) (regs : List ℕ) :
regPairOp out r1 r2 regs =
((regs.set r1 0).set r2 0).set out
(regs.getD out 0 + cantorPair (regs.getD r1 0) (regs.getD r2 0)) := by out:ℕr1:ℕr2:ℕregs:List ℕ⊢ regPairOp out r1 r2 regs =
((regs.set r1 0).set r2 0).set out (regs.getD out 0 + cantorPair (regs.getD r1 0) (regs.getD r2 0))
simp [regPairOp, pairLoop_eq_cantorPair] All goals completed! 🐙
Functional specification of unpair(out1, out2, in) on an 11-register bank regs : List ℕ
when out1 and out2 are initially 0.
def regUnpairOp (out1 out2 rin : ℕ) (regs : List ℕ) : List ℕ :=
let vin := regs.getD rin 0
let p := unpairLoop vin (0, 0)
((regs.set rin 0).set out1 p.1).set out2 p.2theorem regUnpairOp_eq_cantorUnpair (out1 out2 rin : ℕ) (regs : List ℕ) :
regUnpairOp out1 out2 rin regs =
let p := cantorUnpair (regs.getD rin 0)
((regs.set rin 0).set out1 p.1).set out2 p.2 := by out1:ℕout2:ℕrin:ℕregs:List ℕ⊢ regUnpairOp out1 out2 rin regs =
let p := cantorUnpair (regs.getD rin 0);
((regs.set rin 0).set out1 p.1).set out2 p.2
simp [regUnpairOp, unpairLoop_zero_zero] All goals completed! 🐙end ConjectureMachines.Semantics.Zf