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.PA.Arithmetic
public import Cryptids.Zf380
Internal PA Equivalence Between zf_380 and zf_393
This module internalizes the macro-step state-renumbering bisimulation between Machines.zf380 and
Machines.zf393 from Cryptids.Zf380 inside an arbitrary first-order PAModel M via PAM M,
yielding:
mHalts_zf380_iff_zf393: in every PAModel M,
mHalts M Machines.zf380 ↔ mHalts M Machines.zf393.
paProvable_halts_zf380_iff_zf393:
PAProvable ((paHalts Machines.zf380).iff (paHalts Machines.zf393)).
@[expose] public sectionnamespace ConjectureMachines.Semantics.PAopen Turing (Dir)open StateTransitionopen ConjectureMachines.Zf380
(candM refM zf380Trans candM_transition_eq_nat
renum mapState validState validState1 validState1_of_validState validState_next checkNext
expectedTransition isThreeStep isFiveStepLRLR isFiveStepLLRR isSevenStepLLLRRR
isNineStepLRLLLRRR isMultiStep
midP midS lrlrP1 lrlrS1 lrlrP2 lrlrS2 llrrP1 llrrP2 llrrS1 llrrS2
lllrrrP1 lllrrrP2 lllrrrP3 lllrrrS1 lllrrrS2 lllrrrS3
transition_oneStep
transition_threeStep_1 transition_threeStep_2 transition_threeStep_3 threeStep_not_none
transition_fiveStepLRLR_1 transition_fiveStepLRLR_2 transition_fiveStepLRLR_3
transition_fiveStepLRLR_4 transition_fiveStepLRLR_5 fiveStepLRLR_not_none
transition_fiveStepLLRR_1 transition_fiveStepLLRR_2 transition_fiveStepLLRR_3
transition_fiveStepLLRR_4 transition_fiveStepLLRR_5 fiveStepLLRR_not_none
transition_sevenStepLLLRRR_1 transition_sevenStepLLLRRR_2 transition_sevenStepLLLRRR_3
transition_sevenStepLLLRRR_4 transition_sevenStepLLLRRR_5 transition_sevenStepLLLRRR_6
transition_sevenStepLLLRRR_7 sevenStepLLLRRR_not_none
transition_nineStep_0a transition_nineStep_0b transition_nineStep_1 transition_nineStep_2
transition_nineStep_3 transition_nineStep_4 transition_nineStep_5 transition_nineStep_6
transition_nineStep_7 nineStepLRLLLRRR_not_none
cfgOfFast bootR_39753 boot_cand boot_ref rel_boot)section Modelvariable {M : Type*} [PAStructure M] [PAModel M]open PAM
Section 1: Standard nSteps Equivalence and Boot Lifting
private theorem zf380_nSteps_eq_layer1_nSteps {N : ℕ} [NeZero N] (tm : Machine N 2) :
∀ (k : ℕ) (c : Cfg N 2),
ConjectureMachines.Zf380.nSteps tm k c =
ConjectureMachines.Semantics.Riemann.Layer1.nSteps tm k c
| 0, _ => rfl
N:ℕinst✝:NeZero Ntm:Machine N 2k:ℕc:Cfg N 2⊢ Zf380.nSteps tm (k + 1) c = Riemann.Layer1.nSteps tm (k + 1) c N:ℕinst✝:NeZero Ntm:Machine N 2k:ℕc:Cfg N 2⊢ Zf380.nSteps tm (k + 1) c = Riemann.Layer1.nSteps tm (k + 1) c
N:ℕinst✝:NeZero Ntm:Machine N 2k:ℕc:Cfg N 2⊢ (step tm c).bind (Zf380.nSteps tm k) = (step tm c).bind (Riemann.Layer1.nSteps tm k)
cases step tm c with
N:ℕinst✝:NeZero Ntm:Machine N 2k:ℕc:Cfg N 2⊢ none.bind (Zf380.nSteps tm k) = none.bind (Riemann.Layer1.nSteps tm k) All goals completed! 🐙
N:ℕinst✝:NeZero Ntm:Machine N 2k:ℕc:Cfg N 2c':Cfg N 2⊢ (some c').bind (Zf380.nSteps tm k) = (some c').bind (Riemann.Layer1.nSteps tm k) All goals completed! 🐙
Standard k : ℕ step counts in mTracesTo coincide with mNSteps.
theorem mTracesTo_natCast_iff_mNSteps {states : ℕ} {tm : Machine states 2}
(k : ℕ) (a b : MCfg states M) :
mTracesTo tm (k : PAM M) a b ↔ mNSteps tm k a = some b := M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mstates:ℕtm:Machine states 2k:ℕa:MCfg states Mb:MCfg states M⊢ mTracesTo tm (↑k) a b ↔ mNSteps tm k a = some b
M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mstates:ℕtm:Machine states 2k:ℕa:MCfg states Mb:MCfg states Mhtr:mTracesTo tm (↑k) a b⊢ mNSteps tm k a = some b
M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mstates:ℕtm:Machine states 2k:ℕa:MCfg states Mb:MCfg states Mc:PAM Md:PAM Mh0:c.mBeta d 0 = mEncodeCfg ahsteps:∀ i < ↑k, ∃ x y, c.mBeta d i = mEncodeCfg x ∧ c.mBeta d (i + 1) = mEncodeCfg y ∧ mStep tm x = some yhlast:c.mBeta d ↑k = mEncodeCfg b⊢ mNSteps tm k a = some b
M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mstates:ℕtm:Machine states 2k:ℕa:MCfg states Mb:MCfg states Mc:PAM Md:PAM Mh0:c.mBeta d 0 = mEncodeCfg ahsteps:∀ i < ↑k, ∃ x y, c.mBeta d i = mEncodeCfg x ∧ c.mBeta d (i + 1) = mEncodeCfg y ∧ mStep tm x = some yhlast:c.mBeta d ↑k = mEncodeCfg bhwalk:∀ j ≤ k, ∃ bj, mNSteps tm j a = some bj ∧ c.mBeta d ↑j = mEncodeCfg bj⊢ mNSteps tm k a = some b
obtain ⟨bk, hnsk, hbk⟩ := hwalk k le_rfl M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mstates:ℕtm:Machine states 2k:ℕa:MCfg states Mb:MCfg states Mc:PAM Md:PAM Mh0:c.mBeta d 0 = mEncodeCfg ahsteps:∀ i < ↑k, ∃ x y, c.mBeta d i = mEncodeCfg x ∧ c.mBeta d (i + 1) = mEncodeCfg y ∧ mStep tm x = some yhlast:c.mBeta d ↑k = mEncodeCfg bhwalk:∀ j ≤ k, ∃ bj, mNSteps tm j a = some bj ∧ c.mBeta d ↑j = mEncodeCfg bjbk:MCfg states Mhnsk:mNSteps tm k a = some bkhbk:c.mBeta d ↑k = mEncodeCfg bk⊢ mNSteps tm k a = some b
have hbkeq : bk = b := mEncodeCfg_injective (hbk.symm.trans hlast) M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mstates:ℕtm:Machine states 2k:ℕa:MCfg states Mb:MCfg states Mc:PAM Md:PAM Mh0:c.mBeta d 0 = mEncodeCfg ahsteps:∀ i < ↑k, ∃ x y, c.mBeta d i = mEncodeCfg x ∧ c.mBeta d (i + 1) = mEncodeCfg y ∧ mStep tm x = some yhlast:c.mBeta d ↑k = mEncodeCfg bhwalk:∀ j ≤ k, ∃ bj, mNSteps tm j a = some bj ∧ c.mBeta d ↑j = mEncodeCfg bjbk:MCfg states Mhnsk:mNSteps tm k a = some bkhbk:c.mBeta d ↑k = mEncodeCfg bkhbkeq:bk = b⊢ mNSteps tm k a = some b
subst hbkeq M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mstates:ℕtm:Machine states 2k:ℕa:MCfg states Mc:PAM Md:PAM Mh0:c.mBeta d 0 = mEncodeCfg ahsteps:∀ i < ↑k, ∃ x y, c.mBeta d i = mEncodeCfg x ∧ c.mBeta d (i + 1) = mEncodeCfg y ∧ mStep tm x = some yhwalk:∀ j ≤ k, ∃ bj, mNSteps tm j a = some bj ∧ c.mBeta d ↑j = mEncodeCfg bjbk:MCfg states Mhnsk:mNSteps tm k a = some bkhbk:c.mBeta d ↑k = mEncodeCfg bkhlast:c.mBeta d ↑k = mEncodeCfg bk⊢ mNSteps tm k a = some bk
exact hnsk All goals completed! 🐙private theorem mBoot_cand :
mTracesTo Machines.zf380 ((39753 : ℕ) : PAM M) mInit
(embedCfg (M := M) (cfgOfFast 64 [] 0 bootR_39753)) := by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel M⊢ mTracesTo Machines.zf380 (↑39753) mInit (embedCfg (cfgOfFast 64 [] 0 bootR_39753))
have hb := boot_cand M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mhb:Zf380.nSteps candM 39753 init = some (cfgOfFast 64 [] 0 bootR_39753)⊢ mTracesTo Machines.zf380 (↑39753) mInit (embedCfg (cfgOfFast 64 [] 0 bootR_39753))
rw [zf380_nSteps_eq_layer1_nSteps M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mhb:Riemann.Layer1.nSteps candM 39753 init = some (cfgOfFast 64 [] 0 bootR_39753)⊢ mTracesTo Machines.zf380 (↑39753) mInit (embedCfg (cfgOfFast 64 [] 0 bootR_39753))] at hb M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mhb:Riemann.Layer1.nSteps candM 39753 init = some (cfgOfFast 64 [] 0 bootR_39753)⊢ mTracesTo Machines.zf380 (↑39753) mInit (embedCfg (cfgOfFast 64 [] 0 bootR_39753))
have htr := mTracesTo_of_nSteps (M := M) hb M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mhb:Riemann.Layer1.nSteps candM 39753 init = some (cfgOfFast 64 [] 0 bootR_39753)htr:mTracesTo candM (↑39753) (embedCfg init) (embedCfg (cfgOfFast 64 [] 0 bootR_39753))⊢ mTracesTo Machines.zf380 (↑39753) mInit (embedCfg (cfgOfFast 64 [] 0 bootR_39753))
simpa only [embedCfg_init] using htr All goals completed! 🐙private theorem mBoot_ref :
mTracesTo Machines.zf393 ((39753 : ℕ) : PAM M) mInit
(embedCfg (M := M) (cfgOfFast 64 [] 0 bootR_39753)) := by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel M⊢ mTracesTo Machines.zf393 (↑39753) mInit (embedCfg (cfgOfFast 64 [] 0 bootR_39753))
have hb := boot_ref M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mhb:Zf380.nSteps refM 39753 init = some (cfgOfFast 64 [] 0 bootR_39753)⊢ mTracesTo Machines.zf393 (↑39753) mInit (embedCfg (cfgOfFast 64 [] 0 bootR_39753))
rw [zf380_nSteps_eq_layer1_nSteps M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mhb:Riemann.Layer1.nSteps refM 39753 init = some (cfgOfFast 64 [] 0 bootR_39753)⊢ mTracesTo Machines.zf393 (↑39753) mInit (embedCfg (cfgOfFast 64 [] 0 bootR_39753))] at hb M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mhb:Riemann.Layer1.nSteps refM 39753 init = some (cfgOfFast 64 [] 0 bootR_39753)⊢ mTracesTo Machines.zf393 (↑39753) mInit (embedCfg (cfgOfFast 64 [] 0 bootR_39753))
have htr := mTracesTo_of_nSteps (M := M) hb M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mhb:Riemann.Layer1.nSteps refM 39753 init = some (cfgOfFast 64 [] 0 bootR_39753)htr:mTracesTo refM (↑39753) (embedCfg init) (embedCfg (cfgOfFast 64 [] 0 bootR_39753))⊢ mTracesTo Machines.zf393 (↑39753) mInit (embedCfg (cfgOfFast 64 [] 0 bootR_39753))
simpa only [embedCfg_init] using htr All goals completed! 🐙
Section 2: MCfg Macro-Steps and Simulation Relation MRel
Simulation relation between Machines.zf393 and Machines.zf380 on MCfg over PAM M.
def MRel (c₁ : MCfg 393 M) (c₂ : MCfg 380 M) : Prop :=
validState c₁.state.val
(mBit (mHalf (mHalf c₁.left))) (mBit (mHalf c₁.left)) (mBit c₁.left)
c₁.head (mBit c₁.right) = true ∧
c₂ = ⟨mapState c₁.state.val (mBit c₁.left) c₁.head, c₁.head, c₁.left, c₁.right⟩private theorem mBit_eq_iff_mod_eq (x : PAM M) (b : Fin 2) :
mBit x = b ↔ x % 2 = (b.val : PAM M) := by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mx:PAM Mb:Fin 2⊢ x.mBit = b ↔ x % 2 = ↑↑b
rw [← mBit_val_eq_mod M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mx:PAM Mb:Fin 2⊢ x.mBit = b ↔ ↑↑x.mBit = ↑↑b] M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mx:PAM Mb:Fin 2⊢ x.mBit = b ↔ ↑↑x.mBit = ↑↑b
exact ⟨fun h ↦ congrArg (fun u : Fin 2 ↦ (u.val : PAM M)) h,
fun h ↦ Fin.ext (natCast_inj_pam.mp h)⟩ All goals completed! 🐙
First-order definability of MRel on configuration codes in PAM M.
theorem paDef_mRelCode {k : ℕ} {fx₁ fx₂ : (Fin k → PAM M) → PAM M}
(hx₁ : PAFunN k fx₁) (hx₂ : PAFunN k fx₂) :
PADefN k (fun a ↦ ∃ (c₁ : MCfg 393 M) (c₂ : MCfg 380 M),
fx₁ a = mEncodeCfg c₁ ∧ fx₂ a = mEncodeCfg c₂ ∧ MRel c₁ c₂) := by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂⊢ PADefN k fun a ↦ ∃ c₁ c₂, fx₁ a = mEncodeCfg c₁ ∧ fx₂ a = mEncodeCfg c₂ ∧ MRel c₁ c₂
have htuple : ∀ (q : Fin 393) (h l0 l1 l2 r0 : Fin 2),
PADefN k (fun a ↦
validState q.val l2 l1 l0 h r0 = true ∧
∃ L R : PAM M,
L % 2 = (l0.val : PAM M) ∧
(L / 2) % 2 = (l1.val : PAM M) ∧
((L / 2) / 2) % 2 = (l2.val : PAM M) ∧
R % 2 = (r0.val : PAM M) ∧
fx₁ a = mPair (q.val : PAM M) (mPair (h.val : PAM M) (mPair L R)) ∧
fx₂ a = mPair ((mapState q.val l0 h).val : PAM M)
(mPair (h.val : PAM M) (mPair L R))) := by
intro q h l0 l1 l2 r0 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂q:Fin 393h:Fin 2l0:Fin 2l1:Fin 2l2:Fin 2r0:Fin 2⊢ PADefN k fun a ↦
validState (↑q) l2 l1 l0 h r0 = true ∧
∃ L R,
L % 2 = ↑↑l0 ∧
L / 2 % 2 = ↑↑l1 ∧
L / 2 / 2 % 2 = ↑↑l2 ∧
R % 2 = ↑↑r0 ∧
fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R))
let fL : (Fin (k + 2) → PAM M) → PAM M := fun w ↦ w ⟨k, by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂q:Fin 393h:Fin 2l0:Fin 2l1:Fin 2l2:Fin 2r0:Fin 2w:Fin (k + 2) → PAM M⊢ k < k + 2 omega All goals completed! 🐙⟩ M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂q:Fin 393h:Fin 2l0:Fin 2l1:Fin 2l2:Fin 2r0:Fin 2fL:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w ⟨k, ⋯⟩⊢ PADefN k fun a ↦
validState (↑q) l2 l1 l0 h r0 = true ∧
∃ L R,
L % 2 = ↑↑l0 ∧
L / 2 % 2 = ↑↑l1 ∧
L / 2 / 2 % 2 = ↑↑l2 ∧
R % 2 = ↑↑r0 ∧
fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R))
let fR : (Fin (k + 2) → PAM M) → PAM M := fun w ↦ w (Fin.last (k + 1)) M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂q:Fin 393h:Fin 2l0:Fin 2l1:Fin 2l2:Fin 2r0:Fin 2fL:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w ⟨k, ⋯⟩fR:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w (Fin.last (k + 1))⊢ PADefN k fun a ↦
validState (↑q) l2 l1 l0 h r0 = true ∧
∃ L R,
L % 2 = ↑↑l0 ∧
L / 2 % 2 = ↑↑l1 ∧
L / 2 / 2 % 2 = ↑↑l2 ∧
R % 2 = ↑↑r0 ∧
fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R))
have hL : PAFunN (k + 2) fL := paFun_proj ⟨k, by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂q:Fin 393h:Fin 2l0:Fin 2l1:Fin 2l2:Fin 2r0:Fin 2fL:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w ⟨k, ⋯⟩fR:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w (Fin.last (k + 1))⊢ k < k + 2 omega All goals completed! 🐙⟩ M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂q:Fin 393h:Fin 2l0:Fin 2l1:Fin 2l2:Fin 2r0:Fin 2fL:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w ⟨k, ⋯⟩fR:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w (Fin.last (k + 1))hL:PAFunN (k + 2) fL⊢ PADefN k fun a ↦
validState (↑q) l2 l1 l0 h r0 = true ∧
∃ L R,
L % 2 = ↑↑l0 ∧
L / 2 % 2 = ↑↑l1 ∧
L / 2 / 2 % 2 = ↑↑l2 ∧
R % 2 = ↑↑r0 ∧
fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R))
have hR : PAFunN (k + 2) fR := paFun_proj (Fin.last (k + 1)) M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂q:Fin 393h:Fin 2l0:Fin 2l1:Fin 2l2:Fin 2r0:Fin 2fL:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w ⟨k, ⋯⟩fR:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w (Fin.last (k + 1))hL:PAFunN (k + 2) fLhR:PAFunN (k + 2) fR⊢ PADefN k fun a ↦
validState (↑q) l2 l1 l0 h r0 = true ∧
∃ L R,
L % 2 = ↑↑l0 ∧
L / 2 % 2 = ↑↑l1 ∧
L / 2 / 2 % 2 = ↑↑l2 ∧
R % 2 = ↑↑r0 ∧
fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R))
have hx₁' : PAFunN (k + 2) (fun w ↦ fx₁ (Fin.init (Fin.init w))) :=
paFun_weaken (paFun_weaken hx₁) M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂q:Fin 393h:Fin 2l0:Fin 2l1:Fin 2l2:Fin 2r0:Fin 2fL:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w ⟨k, ⋯⟩fR:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w (Fin.last (k + 1))hL:PAFunN (k + 2) fLhR:PAFunN (k + 2) fRhx₁':PAFunN (k + 2) fun w ↦ fx₁ (Fin.init (Fin.init w))⊢ PADefN k fun a ↦
validState (↑q) l2 l1 l0 h r0 = true ∧
∃ L R,
L % 2 = ↑↑l0 ∧
L / 2 % 2 = ↑↑l1 ∧
L / 2 / 2 % 2 = ↑↑l2 ∧
R % 2 = ↑↑r0 ∧
fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R))
have hx₂' : PAFunN (k + 2) (fun w ↦ fx₂ (Fin.init (Fin.init w))) :=
paFun_weaken (paFun_weaken hx₂) M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂q:Fin 393h:Fin 2l0:Fin 2l1:Fin 2l2:Fin 2r0:Fin 2fL:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w ⟨k, ⋯⟩fR:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w (Fin.last (k + 1))hL:PAFunN (k + 2) fLhR:PAFunN (k + 2) fRhx₁':PAFunN (k + 2) fun w ↦ fx₁ (Fin.init (Fin.init w))hx₂':PAFunN (k + 2) fun w ↦ fx₂ (Fin.init (Fin.init w))⊢ PADefN k fun a ↦
validState (↑q) l2 l1 l0 h r0 = true ∧
∃ L R,
L % 2 = ↑↑l0 ∧
L / 2 % 2 = ↑↑l1 ∧
L / 2 / 2 % 2 = ↑↑l2 ∧
R % 2 = ↑↑r0 ∧
fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R))
have hLdiv1 := paFun_div hL (paFun_const 2) M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂q:Fin 393h:Fin 2l0:Fin 2l1:Fin 2l2:Fin 2r0:Fin 2fL:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w ⟨k, ⋯⟩fR:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w (Fin.last (k + 1))hL:PAFunN (k + 2) fLhR:PAFunN (k + 2) fRhx₁':PAFunN (k + 2) fun w ↦ fx₁ (Fin.init (Fin.init w))hx₂':PAFunN (k + 2) fun w ↦ fx₂ (Fin.init (Fin.init w))hLdiv1:PAFunN (k + 2) fun args ↦ fL args / 2⊢ PADefN k fun a ↦
validState (↑q) l2 l1 l0 h r0 = true ∧
∃ L R,
L % 2 = ↑↑l0 ∧
L / 2 % 2 = ↑↑l1 ∧
L / 2 / 2 % 2 = ↑↑l2 ∧
R % 2 = ↑↑r0 ∧
fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R))
have hLdiv2 := paFun_div hLdiv1 (paFun_const 2) M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂q:Fin 393h:Fin 2l0:Fin 2l1:Fin 2l2:Fin 2r0:Fin 2fL:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w ⟨k, ⋯⟩fR:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w (Fin.last (k + 1))hL:PAFunN (k + 2) fLhR:PAFunN (k + 2) fRhx₁':PAFunN (k + 2) fun w ↦ fx₁ (Fin.init (Fin.init w))hx₂':PAFunN (k + 2) fun w ↦ fx₂ (Fin.init (Fin.init w))hLdiv1:PAFunN (k + 2) fun args ↦ fL args / 2hLdiv2:PAFunN (k + 2) fun args ↦ fL args / 2 / 2⊢ PADefN k fun a ↦
validState (↑q) l2 l1 l0 h r0 = true ∧
∃ L R,
L % 2 = ↑↑l0 ∧
L / 2 % 2 = ↑↑l1 ∧
L / 2 / 2 % 2 = ↑↑l2 ∧
R % 2 = ↑↑r0 ∧
fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R))
have hbody : PADefN (k + 2) (fun w : Fin (k + 2) → PAM M ↦
fL w % 2 = (l0.val : PAM M) ∧
(fL w / 2) % 2 = (l1.val : PAM M) ∧
((fL w / 2) / 2) % 2 = (l2.val : PAM M) ∧
fR w % 2 = (r0.val : PAM M) ∧
fx₁ (Fin.init (Fin.init w)) =
mPair (q.val : PAM M) (mPair (h.val : PAM M) (mPair (fL w) (fR w))) ∧
fx₂ (Fin.init (Fin.init w)) =
mPair ((mapState q.val l0 h).val : PAM M)
(mPair (h.val : PAM M) (mPair (fL w) (fR w)))) :=
paDef_and (paDef_eq (paFun_mod hL (paFun_const 2)) (paFun_const _))
(paDef_and (paDef_eq (paFun_mod hLdiv1 (paFun_const 2)) (paFun_const _))
(paDef_and (paDef_eq (paFun_mod hLdiv2 (paFun_const 2)) (paFun_const _))
(paDef_and (paDef_eq (paFun_mod hR (paFun_const 2)) (paFun_const _))
(paDef_and
(paDef_eq hx₁'
(paFun_mPair (paFun_const _) (paFun_mPair (paFun_const _) (paFun_mPair hL hR))))
(paDef_eq hx₂'
(paFun_mPair (paFun_const _)
(paFun_mPair (paFun_const _) (paFun_mPair hL hR)))))))) M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂q:Fin 393h:Fin 2l0:Fin 2l1:Fin 2l2:Fin 2r0:Fin 2fL:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w ⟨k, ⋯⟩fR:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w (Fin.last (k + 1))hL:PAFunN (k + 2) fLhR:PAFunN (k + 2) fRhx₁':PAFunN (k + 2) fun w ↦ fx₁ (Fin.init (Fin.init w))hx₂':PAFunN (k + 2) fun w ↦ fx₂ (Fin.init (Fin.init w))hLdiv1:PAFunN (k + 2) fun args ↦ fL args / 2hLdiv2:PAFunN (k + 2) fun args ↦ fL args / 2 / 2hbody:PADefN (k + 2) fun w ↦
fL w % 2 = ↑↑l0 ∧
fL w / 2 % 2 = ↑↑l1 ∧
fL w / 2 / 2 % 2 = ↑↑l2 ∧
fR w % 2 = ↑↑r0 ∧
fx₁ (Fin.init (Fin.init w)) = (↑↑q).mPair ((↑↑h).mPair ((fL w).mPair (fR w))) ∧
fx₂ (Fin.init (Fin.init w)) = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair ((fL w).mPair (fR w)))⊢ PADefN k fun a ↦
validState (↑q) l2 l1 l0 h r0 = true ∧
∃ L R,
L % 2 = ↑↑l0 ∧
L / 2 % 2 = ↑↑l1 ∧
L / 2 / 2 % 2 = ↑↑l2 ∧
R % 2 = ↑↑r0 ∧
fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R))
have hp : PADefN k (fun _ : Fin k → PAM M ↦ validState q.val l2 l1 l0 h r0 = true) := by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂⊢ PADefN k fun a ↦ ∃ c₁ c₂, fx₁ a = mEncodeCfg c₁ ∧ fx₂ a = mEncodeCfg c₂ ∧ MRel c₁ c₂
cases validState q.val l2 l1 l0 h r0 false M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂q:Fin 393h:Fin 2l0:Fin 2l1:Fin 2l2:Fin 2r0:Fin 2fL:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w ⟨k, ⋯⟩fR:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w (Fin.last (k + 1))hL:PAFunN (k + 2) fLhR:PAFunN (k + 2) fRhx₁':PAFunN (k + 2) fun w ↦ fx₁ (Fin.init (Fin.init w))hx₂':PAFunN (k + 2) fun w ↦ fx₂ (Fin.init (Fin.init w))hLdiv1:PAFunN (k + 2) fun args ↦ fL args / 2hLdiv2:PAFunN (k + 2) fun args ↦ fL args / 2 / 2hbody:PADefN (k + 2) fun w ↦
fL w % 2 = ↑↑l0 ∧
fL w / 2 % 2 = ↑↑l1 ∧
fL w / 2 / 2 % 2 = ↑↑l2 ∧
fR w % 2 = ↑↑r0 ∧
fx₁ (Fin.init (Fin.init w)) = (↑↑q).mPair ((↑↑h).mPair ((fL w).mPair (fR w))) ∧
fx₂ (Fin.init (Fin.init w)) = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair ((fL w).mPair (fR w)))⊢ PADefN k fun x ↦ false = truetrue M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂q:Fin 393h:Fin 2l0:Fin 2l1:Fin 2l2:Fin 2r0:Fin 2fL:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w ⟨k, ⋯⟩fR:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w (Fin.last (k + 1))hL:PAFunN (k + 2) fLhR:PAFunN (k + 2) fRhx₁':PAFunN (k + 2) fun w ↦ fx₁ (Fin.init (Fin.init w))hx₂':PAFunN (k + 2) fun w ↦ fx₂ (Fin.init (Fin.init w))hLdiv1:PAFunN (k + 2) fun args ↦ fL args / 2hLdiv2:PAFunN (k + 2) fun args ↦ fL args / 2 / 2hbody:PADefN (k + 2) fun w ↦
fL w % 2 = ↑↑l0 ∧
fL w / 2 % 2 = ↑↑l1 ∧
fL w / 2 / 2 % 2 = ↑↑l2 ∧
fR w % 2 = ↑↑r0 ∧
fx₁ (Fin.init (Fin.init w)) = (↑↑q).mPair ((↑↑h).mPair ((fL w).mPair (fR w))) ∧
fx₂ (Fin.init (Fin.init w)) = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair ((fL w).mPair (fR w)))⊢ PADefN k fun x ↦ true = true
· false M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂q:Fin 393h:Fin 2l0:Fin 2l1:Fin 2l2:Fin 2r0:Fin 2fL:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w ⟨k, ⋯⟩fR:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w (Fin.last (k + 1))hL:PAFunN (k + 2) fLhR:PAFunN (k + 2) fRhx₁':PAFunN (k + 2) fun w ↦ fx₁ (Fin.init (Fin.init w))hx₂':PAFunN (k + 2) fun w ↦ fx₂ (Fin.init (Fin.init w))hLdiv1:PAFunN (k + 2) fun args ↦ fL args / 2hLdiv2:PAFunN (k + 2) fun args ↦ fL args / 2 / 2hbody:PADefN (k + 2) fun w ↦
fL w % 2 = ↑↑l0 ∧
fL w / 2 % 2 = ↑↑l1 ∧
fL w / 2 / 2 % 2 = ↑↑l2 ∧
fR w % 2 = ↑↑r0 ∧
fx₁ (Fin.init (Fin.init w)) = (↑↑q).mPair ((↑↑h).mPair ((fL w).mPair (fR w))) ∧
fx₂ (Fin.init (Fin.init w)) = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair ((fL w).mPair (fR w)))⊢ PADefN k fun x ↦ false = true exact paDefN_congr (fun _ ↦ by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂q:Fin 393h:Fin 2l0:Fin 2l1:Fin 2l2:Fin 2r0:Fin 2fL:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w ⟨k, ⋯⟩fR:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w (Fin.last (k + 1))hL:PAFunN (k + 2) fLhR:PAFunN (k + 2) fRhx₁':PAFunN (k + 2) fun w ↦ fx₁ (Fin.init (Fin.init w))hx₂':PAFunN (k + 2) fun w ↦ fx₂ (Fin.init (Fin.init w))hLdiv1:PAFunN (k + 2) fun args ↦ fL args / 2hLdiv2:PAFunN (k + 2) fun args ↦ fL args / 2 / 2hbody:PADefN (k + 2) fun w ↦
fL w % 2 = ↑↑l0 ∧
fL w / 2 % 2 = ↑↑l1 ∧
fL w / 2 / 2 % 2 = ↑↑l2 ∧
fR w % 2 = ↑↑r0 ∧
fx₁ (Fin.init (Fin.init w)) = (↑↑q).mPair ((↑↑h).mPair ((fL w).mPair (fR w))) ∧
fx₂ (Fin.init (Fin.init w)) = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair ((fL w).mPair (fR w)))x✝:Fin k → PAM M⊢ False ↔ false = true simp All goals completed! 🐙) (paDef_false k)
· true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂q:Fin 393h:Fin 2l0:Fin 2l1:Fin 2l2:Fin 2r0:Fin 2fL:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w ⟨k, ⋯⟩fR:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w (Fin.last (k + 1))hL:PAFunN (k + 2) fLhR:PAFunN (k + 2) fRhx₁':PAFunN (k + 2) fun w ↦ fx₁ (Fin.init (Fin.init w))hx₂':PAFunN (k + 2) fun w ↦ fx₂ (Fin.init (Fin.init w))hLdiv1:PAFunN (k + 2) fun args ↦ fL args / 2hLdiv2:PAFunN (k + 2) fun args ↦ fL args / 2 / 2hbody:PADefN (k + 2) fun w ↦
fL w % 2 = ↑↑l0 ∧
fL w / 2 % 2 = ↑↑l1 ∧
fL w / 2 / 2 % 2 = ↑↑l2 ∧
fR w % 2 = ↑↑r0 ∧
fx₁ (Fin.init (Fin.init w)) = (↑↑q).mPair ((↑↑h).mPair ((fL w).mPair (fR w))) ∧
fx₂ (Fin.init (Fin.init w)) = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair ((fL w).mPair (fR w)))⊢ PADefN k fun x ↦ true = true exact paDefN_congr (fun _ ↦ by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂q:Fin 393h:Fin 2l0:Fin 2l1:Fin 2l2:Fin 2r0:Fin 2fL:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w ⟨k, ⋯⟩fR:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w (Fin.last (k + 1))hL:PAFunN (k + 2) fLhR:PAFunN (k + 2) fRhx₁':PAFunN (k + 2) fun w ↦ fx₁ (Fin.init (Fin.init w))hx₂':PAFunN (k + 2) fun w ↦ fx₂ (Fin.init (Fin.init w))hLdiv1:PAFunN (k + 2) fun args ↦ fL args / 2hLdiv2:PAFunN (k + 2) fun args ↦ fL args / 2 / 2hbody:PADefN (k + 2) fun w ↦
fL w % 2 = ↑↑l0 ∧
fL w / 2 % 2 = ↑↑l1 ∧
fL w / 2 / 2 % 2 = ↑↑l2 ∧
fR w % 2 = ↑↑r0 ∧
fx₁ (Fin.init (Fin.init w)) = (↑↑q).mPair ((↑↑h).mPair ((fL w).mPair (fR w))) ∧
fx₂ (Fin.init (Fin.init w)) = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair ((fL w).mPair (fR w)))x✝:Fin k → PAM M⊢ True ↔ true = true simp All goals completed! 🐙) (paDef_true k) M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂q:Fin 393h:Fin 2l0:Fin 2l1:Fin 2l2:Fin 2r0:Fin 2fL:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w ⟨k, ⋯⟩fR:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w (Fin.last (k + 1))hL:PAFunN (k + 2) fLhR:PAFunN (k + 2) fRhx₁':PAFunN (k + 2) fun w ↦ fx₁ (Fin.init (Fin.init w))hx₂':PAFunN (k + 2) fun w ↦ fx₂ (Fin.init (Fin.init w))hLdiv1:PAFunN (k + 2) fun args ↦ fL args / 2hLdiv2:PAFunN (k + 2) fun args ↦ fL args / 2 / 2hbody:PADefN (k + 2) fun w ↦
fL w % 2 = ↑↑l0 ∧
fL w / 2 % 2 = ↑↑l1 ∧
fL w / 2 / 2 % 2 = ↑↑l2 ∧
fR w % 2 = ↑↑r0 ∧
fx₁ (Fin.init (Fin.init w)) = (↑↑q).mPair ((↑↑h).mPair ((fL w).mPair (fR w))) ∧
fx₂ (Fin.init (Fin.init w)) = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair ((fL w).mPair (fR w)))hp:PADefN k fun x ↦ validState (↑q) l2 l1 l0 h r0 = true⊢ PADefN k fun a ↦
validState (↑q) l2 l1 l0 h r0 = true ∧
∃ L R,
L % 2 = ↑↑l0 ∧
L / 2 % 2 = ↑↑l1 ∧
L / 2 / 2 % 2 = ↑↑l2 ∧
R % 2 = ↑↑r0 ∧
fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R))
refine paDef_and hp (paDefN_congr (fun a ↦ ?_) (paDef_ex (paDef_ex hbody))) M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂q:Fin 393h:Fin 2l0:Fin 2l1:Fin 2l2:Fin 2r0:Fin 2fL:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w ⟨k, ⋯⟩fR:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w (Fin.last (k + 1))hL:PAFunN (k + 2) fLhR:PAFunN (k + 2) fRhx₁':PAFunN (k + 2) fun w ↦ fx₁ (Fin.init (Fin.init w))hx₂':PAFunN (k + 2) fun w ↦ fx₂ (Fin.init (Fin.init w))hLdiv1:PAFunN (k + 2) fun args ↦ fL args / 2hLdiv2:PAFunN (k + 2) fun args ↦ fL args / 2 / 2hbody:PADefN (k + 2) fun w ↦
fL w % 2 = ↑↑l0 ∧
fL w / 2 % 2 = ↑↑l1 ∧
fL w / 2 / 2 % 2 = ↑↑l2 ∧
fR w % 2 = ↑↑r0 ∧
fx₁ (Fin.init (Fin.init w)) = (↑↑q).mPair ((↑↑h).mPair ((fL w).mPair (fR w))) ∧
fx₂ (Fin.init (Fin.init w)) = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair ((fL w).mPair (fR w)))hp:PADefN k fun x ↦ validState (↑q) l2 l1 l0 h r0 = truea:Fin k → PAM M⊢ (∃ a_1 a_2,
fL (Fin.snoc (Fin.snoc a a_1) a_2) % 2 = ↑↑l0 ∧
fL (Fin.snoc (Fin.snoc a a_1) a_2) / 2 % 2 = ↑↑l1 ∧
fL (Fin.snoc (Fin.snoc a a_1) a_2) / 2 / 2 % 2 = ↑↑l2 ∧
fR (Fin.snoc (Fin.snoc a a_1) a_2) % 2 = ↑↑r0 ∧
fx₁ (Fin.init (Fin.init (Fin.snoc (Fin.snoc a a_1) a_2))) =
(↑↑q).mPair
((↑↑h).mPair ((fL (Fin.snoc (Fin.snoc a a_1) a_2)).mPair (fR (Fin.snoc (Fin.snoc a a_1) a_2)))) ∧
fx₂ (Fin.init (Fin.init (Fin.snoc (Fin.snoc a a_1) a_2))) =
(↑↑(mapState (↑q) l0 h)).mPair
((↑↑h).mPair ((fL (Fin.snoc (Fin.snoc a a_1) a_2)).mPair (fR (Fin.snoc (Fin.snoc a a_1) a_2))))) ↔
∃ L R,
L % 2 = ↑↑l0 ∧
L / 2 % 2 = ↑↑l1 ∧
L / 2 / 2 % 2 = ↑↑l2 ∧
R % 2 = ↑↑r0 ∧
fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R))
refine exists_congr fun L ↦ exists_congr fun R ↦ ?_ M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂q:Fin 393h:Fin 2l0:Fin 2l1:Fin 2l2:Fin 2r0:Fin 2fL:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w ⟨k, ⋯⟩fR:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w (Fin.last (k + 1))hL:PAFunN (k + 2) fLhR:PAFunN (k + 2) fRhx₁':PAFunN (k + 2) fun w ↦ fx₁ (Fin.init (Fin.init w))hx₂':PAFunN (k + 2) fun w ↦ fx₂ (Fin.init (Fin.init w))hLdiv1:PAFunN (k + 2) fun args ↦ fL args / 2hLdiv2:PAFunN (k + 2) fun args ↦ fL args / 2 / 2hbody:PADefN (k + 2) fun w ↦
fL w % 2 = ↑↑l0 ∧
fL w / 2 % 2 = ↑↑l1 ∧
fL w / 2 / 2 % 2 = ↑↑l2 ∧
fR w % 2 = ↑↑r0 ∧
fx₁ (Fin.init (Fin.init w)) = (↑↑q).mPair ((↑↑h).mPair ((fL w).mPair (fR w))) ∧
fx₂ (Fin.init (Fin.init w)) = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair ((fL w).mPair (fR w)))hp:PADefN k fun x ↦ validState (↑q) l2 l1 l0 h r0 = truea:Fin k → PAM ML:PAM MR:PAM M⊢ fL (Fin.snoc (Fin.snoc a L) R) % 2 = ↑↑l0 ∧
fL (Fin.snoc (Fin.snoc a L) R) / 2 % 2 = ↑↑l1 ∧
fL (Fin.snoc (Fin.snoc a L) R) / 2 / 2 % 2 = ↑↑l2 ∧
fR (Fin.snoc (Fin.snoc a L) R) % 2 = ↑↑r0 ∧
fx₁ (Fin.init (Fin.init (Fin.snoc (Fin.snoc a L) R))) =
(↑↑q).mPair ((↑↑h).mPair ((fL (Fin.snoc (Fin.snoc a L) R)).mPair (fR (Fin.snoc (Fin.snoc a L) R)))) ∧
fx₂ (Fin.init (Fin.init (Fin.snoc (Fin.snoc a L) R))) =
(↑↑(mapState (↑q) l0 h)).mPair
((↑↑h).mPair ((fL (Fin.snoc (Fin.snoc a L) R)).mPair (fR (Fin.snoc (Fin.snoc a L) R)))) ↔
L % 2 = ↑↑l0 ∧
L / 2 % 2 = ↑↑l1 ∧
L / 2 / 2 % 2 = ↑↑l2 ∧
R % 2 = ↑↑r0 ∧
fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R))
dsimp only [fL, fR] M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂q:Fin 393h:Fin 2l0:Fin 2l1:Fin 2l2:Fin 2r0:Fin 2fL:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w ⟨k, ⋯⟩fR:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w (Fin.last (k + 1))hL:PAFunN (k + 2) fLhR:PAFunN (k + 2) fRhx₁':PAFunN (k + 2) fun w ↦ fx₁ (Fin.init (Fin.init w))hx₂':PAFunN (k + 2) fun w ↦ fx₂ (Fin.init (Fin.init w))hLdiv1:PAFunN (k + 2) fun args ↦ fL args / 2hLdiv2:PAFunN (k + 2) fun args ↦ fL args / 2 / 2hbody:PADefN (k + 2) fun w ↦
fL w % 2 = ↑↑l0 ∧
fL w / 2 % 2 = ↑↑l1 ∧
fL w / 2 / 2 % 2 = ↑↑l2 ∧
fR w % 2 = ↑↑r0 ∧
fx₁ (Fin.init (Fin.init w)) = (↑↑q).mPair ((↑↑h).mPair ((fL w).mPair (fR w))) ∧
fx₂ (Fin.init (Fin.init w)) = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair ((fL w).mPair (fR w)))hp:PADefN k fun x ↦ validState (↑q) l2 l1 l0 h r0 = truea:Fin k → PAM ML:PAM MR:PAM M⊢ Fin.snoc (Fin.snoc a L) R ⟨k, ⋯⟩ % 2 = ↑↑l0 ∧
Fin.snoc (Fin.snoc a L) R ⟨k, ⋯⟩ / 2 % 2 = ↑↑l1 ∧
Fin.snoc (Fin.snoc a L) R ⟨k, ⋯⟩ / 2 / 2 % 2 = ↑↑l2 ∧
Fin.snoc (Fin.snoc a L) R (Fin.last (k + 1)) % 2 = ↑↑r0 ∧
fx₁ (Fin.init (Fin.init (Fin.snoc (Fin.snoc a L) R))) =
(↑↑q).mPair
((↑↑h).mPair
((Fin.snoc (Fin.snoc a L) R ⟨k, ⋯⟩).mPair (Fin.snoc (Fin.snoc a L) R (Fin.last (k + 1))))) ∧
fx₂ (Fin.init (Fin.init (Fin.snoc (Fin.snoc a L) R))) =
(↑↑(mapState (↑q) l0 h)).mPair
((↑↑h).mPair
((Fin.snoc (Fin.snoc a L) R ⟨k, ⋯⟩).mPair (Fin.snoc (Fin.snoc a L) R (Fin.last (k + 1))))) ↔
L % 2 = ↑↑l0 ∧
L / 2 % 2 = ↑↑l1 ∧
L / 2 / 2 % 2 = ↑↑l2 ∧
R % 2 = ↑↑r0 ∧
fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R))
rw [Fin.snoc_last, M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂q:Fin 393h:Fin 2l0:Fin 2l1:Fin 2l2:Fin 2r0:Fin 2fL:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w ⟨k, ⋯⟩fR:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w (Fin.last (k + 1))hL:PAFunN (k + 2) fLhR:PAFunN (k + 2) fRhx₁':PAFunN (k + 2) fun w ↦ fx₁ (Fin.init (Fin.init w))hx₂':PAFunN (k + 2) fun w ↦ fx₂ (Fin.init (Fin.init w))hLdiv1:PAFunN (k + 2) fun args ↦ fL args / 2hLdiv2:PAFunN (k + 2) fun args ↦ fL args / 2 / 2hbody:PADefN (k + 2) fun w ↦
fL w % 2 = ↑↑l0 ∧
fL w / 2 % 2 = ↑↑l1 ∧
fL w / 2 / 2 % 2 = ↑↑l2 ∧
fR w % 2 = ↑↑r0 ∧
fx₁ (Fin.init (Fin.init w)) = (↑↑q).mPair ((↑↑h).mPair ((fL w).mPair (fR w))) ∧
fx₂ (Fin.init (Fin.init w)) = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair ((fL w).mPair (fR w)))hp:PADefN k fun x ↦ validState (↑q) l2 l1 l0 h r0 = truea:Fin k → PAM ML:PAM MR:PAM M⊢ Fin.snoc (Fin.snoc a L) R ⟨k, ⋯⟩ % 2 = ↑↑l0 ∧
Fin.snoc (Fin.snoc a L) R ⟨k, ⋯⟩ / 2 % 2 = ↑↑l1 ∧
Fin.snoc (Fin.snoc a L) R ⟨k, ⋯⟩ / 2 / 2 % 2 = ↑↑l2 ∧
R % 2 = ↑↑r0 ∧
fx₁ (Fin.init (Fin.init (Fin.snoc (Fin.snoc a L) R))) =
(↑↑q).mPair ((↑↑h).mPair ((Fin.snoc (Fin.snoc a L) R ⟨k, ⋯⟩).mPair R)) ∧
fx₂ (Fin.init (Fin.init (Fin.snoc (Fin.snoc a L) R))) =
(↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair ((Fin.snoc (Fin.snoc a L) R ⟨k, ⋯⟩).mPair R)) ↔
L % 2 = ↑↑l0 ∧
L / 2 % 2 = ↑↑l1 ∧
L / 2 / 2 % 2 = ↑↑l2 ∧
R % 2 = ↑↑r0 ∧
fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R)) Fin.init_snoc, M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂q:Fin 393h:Fin 2l0:Fin 2l1:Fin 2l2:Fin 2r0:Fin 2fL:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w ⟨k, ⋯⟩fR:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w (Fin.last (k + 1))hL:PAFunN (k + 2) fLhR:PAFunN (k + 2) fRhx₁':PAFunN (k + 2) fun w ↦ fx₁ (Fin.init (Fin.init w))hx₂':PAFunN (k + 2) fun w ↦ fx₂ (Fin.init (Fin.init w))hLdiv1:PAFunN (k + 2) fun args ↦ fL args / 2hLdiv2:PAFunN (k + 2) fun args ↦ fL args / 2 / 2hbody:PADefN (k + 2) fun w ↦
fL w % 2 = ↑↑l0 ∧
fL w / 2 % 2 = ↑↑l1 ∧
fL w / 2 / 2 % 2 = ↑↑l2 ∧
fR w % 2 = ↑↑r0 ∧
fx₁ (Fin.init (Fin.init w)) = (↑↑q).mPair ((↑↑h).mPair ((fL w).mPair (fR w))) ∧
fx₂ (Fin.init (Fin.init w)) = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair ((fL w).mPair (fR w)))hp:PADefN k fun x ↦ validState (↑q) l2 l1 l0 h r0 = truea:Fin k → PAM ML:PAM MR:PAM M⊢ Fin.snoc (Fin.snoc a L) R ⟨k, ⋯⟩ % 2 = ↑↑l0 ∧
Fin.snoc (Fin.snoc a L) R ⟨k, ⋯⟩ / 2 % 2 = ↑↑l1 ∧
Fin.snoc (Fin.snoc a L) R ⟨k, ⋯⟩ / 2 / 2 % 2 = ↑↑l2 ∧
R % 2 = ↑↑r0 ∧
fx₁ (Fin.init (Fin.snoc a L)) = (↑↑q).mPair ((↑↑h).mPair ((Fin.snoc (Fin.snoc a L) R ⟨k, ⋯⟩).mPair R)) ∧
fx₂ (Fin.init (Fin.snoc a L)) =
(↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair ((Fin.snoc (Fin.snoc a L) R ⟨k, ⋯⟩).mPair R)) ↔
L % 2 = ↑↑l0 ∧
L / 2 % 2 = ↑↑l1 ∧
L / 2 / 2 % 2 = ↑↑l2 ∧
R % 2 = ↑↑r0 ∧
fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R)) Fin.init_snoc, M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂q:Fin 393h:Fin 2l0:Fin 2l1:Fin 2l2:Fin 2r0:Fin 2fL:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w ⟨k, ⋯⟩fR:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w (Fin.last (k + 1))hL:PAFunN (k + 2) fLhR:PAFunN (k + 2) fRhx₁':PAFunN (k + 2) fun w ↦ fx₁ (Fin.init (Fin.init w))hx₂':PAFunN (k + 2) fun w ↦ fx₂ (Fin.init (Fin.init w))hLdiv1:PAFunN (k + 2) fun args ↦ fL args / 2hLdiv2:PAFunN (k + 2) fun args ↦ fL args / 2 / 2hbody:PADefN (k + 2) fun w ↦
fL w % 2 = ↑↑l0 ∧
fL w / 2 % 2 = ↑↑l1 ∧
fL w / 2 / 2 % 2 = ↑↑l2 ∧
fR w % 2 = ↑↑r0 ∧
fx₁ (Fin.init (Fin.init w)) = (↑↑q).mPair ((↑↑h).mPair ((fL w).mPair (fR w))) ∧
fx₂ (Fin.init (Fin.init w)) = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair ((fL w).mPair (fR w)))hp:PADefN k fun x ↦ validState (↑q) l2 l1 l0 h r0 = truea:Fin k → PAM ML:PAM MR:PAM M⊢ Fin.snoc (Fin.snoc a L) R ⟨k, ⋯⟩ % 2 = ↑↑l0 ∧
Fin.snoc (Fin.snoc a L) R ⟨k, ⋯⟩ / 2 % 2 = ↑↑l1 ∧
Fin.snoc (Fin.snoc a L) R ⟨k, ⋯⟩ / 2 / 2 % 2 = ↑↑l2 ∧
R % 2 = ↑↑r0 ∧
fx₁ a = (↑↑q).mPair ((↑↑h).mPair ((Fin.snoc (Fin.snoc a L) R ⟨k, ⋯⟩).mPair R)) ∧
fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair ((Fin.snoc (Fin.snoc a L) R ⟨k, ⋯⟩).mPair R)) ↔
L % 2 = ↑↑l0 ∧
L / 2 % 2 = ↑↑l1 ∧
L / 2 / 2 % 2 = ↑↑l2 ∧
R % 2 = ↑↑r0 ∧
fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R))
fin_snoc_lt _ _ (by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂q:Fin 393h:Fin 2l0:Fin 2l1:Fin 2l2:Fin 2r0:Fin 2fL:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w ⟨k, ⋯⟩fR:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w (Fin.last (k + 1))hL:PAFunN (k + 2) fLhR:PAFunN (k + 2) fRhx₁':PAFunN (k + 2) fun w ↦ fx₁ (Fin.init (Fin.init w))hx₂':PAFunN (k + 2) fun w ↦ fx₂ (Fin.init (Fin.init w))hLdiv1:PAFunN (k + 2) fun args ↦ fL args / 2hLdiv2:PAFunN (k + 2) fun args ↦ fL args / 2 / 2hbody:PADefN (k + 2) fun w ↦
fL w % 2 = ↑↑l0 ∧
fL w / 2 % 2 = ↑↑l1 ∧
fL w / 2 / 2 % 2 = ↑↑l2 ∧
fR w % 2 = ↑↑r0 ∧
fx₁ (Fin.init (Fin.init w)) = (↑↑q).mPair ((↑↑h).mPair ((fL w).mPair (fR w))) ∧
fx₂ (Fin.init (Fin.init w)) = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair ((fL w).mPair (fR w)))hp:PADefN k fun x ↦ validState (↑q) l2 l1 l0 h r0 = truea:Fin k → PAM ML:PAM MR:PAM M⊢ k < k.succ + 1 omega All goals completed! 🐙) (Nat.lt_succ_self k), fin_snoc_eq M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂q:Fin 393h:Fin 2l0:Fin 2l1:Fin 2l2:Fin 2r0:Fin 2fL:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w ⟨k, ⋯⟩fR:(Fin (k + 2) → PAM M) → PAM M := fun w ↦ w (Fin.last (k + 1))hL:PAFunN (k + 2) fLhR:PAFunN (k + 2) fRhx₁':PAFunN (k + 2) fun w ↦ fx₁ (Fin.init (Fin.init w))hx₂':PAFunN (k + 2) fun w ↦ fx₂ (Fin.init (Fin.init w))hLdiv1:PAFunN (k + 2) fun args ↦ fL args / 2hLdiv2:PAFunN (k + 2) fun args ↦ fL args / 2 / 2hbody:PADefN (k + 2) fun w ↦
fL w % 2 = ↑↑l0 ∧
fL w / 2 % 2 = ↑↑l1 ∧
fL w / 2 / 2 % 2 = ↑↑l2 ∧
fR w % 2 = ↑↑r0 ∧
fx₁ (Fin.init (Fin.init w)) = (↑↑q).mPair ((↑↑h).mPair ((fL w).mPair (fR w))) ∧
fx₂ (Fin.init (Fin.init w)) = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair ((fL w).mPair (fR w)))hp:PADefN k fun x ↦ validState (↑q) l2 l1 l0 h r0 = truea:Fin k → PAM ML:PAM MR:PAM M⊢ L % 2 = ↑↑l0 ∧
L / 2 % 2 = ↑↑l1 ∧
L / 2 / 2 % 2 = ↑↑l2 ∧
R % 2 = ↑↑r0 ∧
fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R)) ↔
L % 2 = ↑↑l0 ∧
L / 2 % 2 = ↑↑l1 ∧
L / 2 / 2 % 2 = ↑↑l2 ∧
R % 2 = ↑↑r0 ∧
fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R))] M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂htuple:∀ (q : Fin 393) (h l0 l1 l2 r0 : Fin 2),
PADefN k fun a ↦
validState (↑q) l2 l1 l0 h r0 = true ∧
∃ L R,
L % 2 = ↑↑l0 ∧
L / 2 % 2 = ↑↑l1 ∧
L / 2 / 2 % 2 = ↑↑l2 ∧
R % 2 = ↑↑r0 ∧
fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R))⊢ PADefN k fun a ↦ ∃ c₁ c₂, fx₁ a = mEncodeCfg c₁ ∧ fx₂ a = mEncodeCfg c₂ ∧ MRel c₁ c₂
refine paDefN_congr (fun a ↦ ?_)
(paDef_fin_exists fun q ↦ paDef_fin_exists fun h ↦ paDef_fin_exists fun l0 ↦
paDef_fin_exists fun l1 ↦ paDef_fin_exists fun l2 ↦ paDef_fin_exists fun r0 ↦
htuple q h l0 l1 l2 r0) M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂htuple:∀ (q : Fin 393) (h l0 l1 l2 r0 : Fin 2),
PADefN k fun a ↦
validState (↑q) l2 l1 l0 h r0 = true ∧
∃ L R,
L % 2 = ↑↑l0 ∧
L / 2 % 2 = ↑↑l1 ∧
L / 2 / 2 % 2 = ↑↑l2 ∧
R % 2 = ↑↑r0 ∧
fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R))a:Fin k → PAM M⊢ (∃ i i_1 i_2 i_3 i_4 i_5,
validState (↑i) i_4 i_3 i_2 i_1 i_5 = true ∧
∃ L R,
L % 2 = ↑↑i_2 ∧
L / 2 % 2 = ↑↑i_3 ∧
L / 2 / 2 % 2 = ↑↑i_4 ∧
R % 2 = ↑↑i_5 ∧
fx₁ a = (↑↑i).mPair ((↑↑i_1).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑i) i_2 i_1)).mPair ((↑↑i_1).mPair (L.mPair R))) ↔
∃ c₁ c₂, fx₁ a = mEncodeCfg c₁ ∧ fx₂ a = mEncodeCfg c₂ ∧ MRel c₁ c₂
constructor mp M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂htuple:∀ (q : Fin 393) (h l0 l1 l2 r0 : Fin 2),
PADefN k fun a ↦
validState (↑q) l2 l1 l0 h r0 = true ∧
∃ L R,
L % 2 = ↑↑l0 ∧
L / 2 % 2 = ↑↑l1 ∧
L / 2 / 2 % 2 = ↑↑l2 ∧
R % 2 = ↑↑r0 ∧
fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R))a:Fin k → PAM M⊢ (∃ i i_1 i_2 i_3 i_4 i_5,
validState (↑i) i_4 i_3 i_2 i_1 i_5 = true ∧
∃ L R,
L % 2 = ↑↑i_2 ∧
L / 2 % 2 = ↑↑i_3 ∧
L / 2 / 2 % 2 = ↑↑i_4 ∧
R % 2 = ↑↑i_5 ∧
fx₁ a = (↑↑i).mPair ((↑↑i_1).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑i) i_2 i_1)).mPair ((↑↑i_1).mPair (L.mPair R))) →
∃ c₁ c₂, fx₁ a = mEncodeCfg c₁ ∧ fx₂ a = mEncodeCfg c₂ ∧ MRel c₁ c₂mpr M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂htuple:∀ (q : Fin 393) (h l0 l1 l2 r0 : Fin 2),
PADefN k fun a ↦
validState (↑q) l2 l1 l0 h r0 = true ∧
∃ L R,
L % 2 = ↑↑l0 ∧
L / 2 % 2 = ↑↑l1 ∧
L / 2 / 2 % 2 = ↑↑l2 ∧
R % 2 = ↑↑r0 ∧
fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R))a:Fin k → PAM M⊢ (∃ c₁ c₂, fx₁ a = mEncodeCfg c₁ ∧ fx₂ a = mEncodeCfg c₂ ∧ MRel c₁ c₂) →
∃ i i_1 i_2 i_3 i_4 i_5,
validState (↑i) i_4 i_3 i_2 i_1 i_5 = true ∧
∃ L R,
L % 2 = ↑↑i_2 ∧
L / 2 % 2 = ↑↑i_3 ∧
L / 2 / 2 % 2 = ↑↑i_4 ∧
R % 2 = ↑↑i_5 ∧
fx₁ a = (↑↑i).mPair ((↑↑i_1).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑i) i_2 i_1)).mPair ((↑↑i_1).mPair (L.mPair R))
· mp M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂htuple:∀ (q : Fin 393) (h l0 l1 l2 r0 : Fin 2),
PADefN k fun a ↦
validState (↑q) l2 l1 l0 h r0 = true ∧
∃ L R,
L % 2 = ↑↑l0 ∧
L / 2 % 2 = ↑↑l1 ∧
L / 2 / 2 % 2 = ↑↑l2 ∧
R % 2 = ↑↑r0 ∧
fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R))a:Fin k → PAM M⊢ (∃ i i_1 i_2 i_3 i_4 i_5,
validState (↑i) i_4 i_3 i_2 i_1 i_5 = true ∧
∃ L R,
L % 2 = ↑↑i_2 ∧
L / 2 % 2 = ↑↑i_3 ∧
L / 2 / 2 % 2 = ↑↑i_4 ∧
R % 2 = ↑↑i_5 ∧
fx₁ a = (↑↑i).mPair ((↑↑i_1).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑i) i_2 i_1)).mPair ((↑↑i_1).mPair (L.mPair R))) →
∃ c₁ c₂, fx₁ a = mEncodeCfg c₁ ∧ fx₂ a = mEncodeCfg c₂ ∧ MRel c₁ c₂ rintro ⟨q, h, l0, l1, l2, r0, hv, L, R, hl0, hl1, hl2, hr0, hx1, hx2⟩ mp M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂htuple:∀ (q : Fin 393) (h l0 l1 l2 r0 : Fin 2),
PADefN k fun a ↦
validState (↑q) l2 l1 l0 h r0 = true ∧
∃ L R,
L % 2 = ↑↑l0 ∧
L / 2 % 2 = ↑↑l1 ∧
L / 2 / 2 % 2 = ↑↑l2 ∧
R % 2 = ↑↑r0 ∧
fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R))a:Fin k → PAM Mq:Fin 393h:Fin 2l0:Fin 2l1:Fin 2l2:Fin 2r0:Fin 2hv:validState (↑q) l2 l1 l0 h r0 = trueL:PAM MR:PAM Mhl0:L % 2 = ↑↑l0hl1:L / 2 % 2 = ↑↑l1hl2:L / 2 / 2 % 2 = ↑↑l2hr0:R % 2 = ↑↑r0hx1:fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R))hx2:fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R))⊢ ∃ c₁ c₂, fx₁ a = mEncodeCfg c₁ ∧ fx₂ a = mEncodeCfg c₂ ∧ MRel c₁ c₂
have hb0 : mBit L = l0 := (mBit_eq_iff_mod_eq L l0).mpr hl0 mp M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂htuple:∀ (q : Fin 393) (h l0 l1 l2 r0 : Fin 2),
PADefN k fun a ↦
validState (↑q) l2 l1 l0 h r0 = true ∧
∃ L R,
L % 2 = ↑↑l0 ∧
L / 2 % 2 = ↑↑l1 ∧
L / 2 / 2 % 2 = ↑↑l2 ∧
R % 2 = ↑↑r0 ∧
fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R))a:Fin k → PAM Mq:Fin 393h:Fin 2l0:Fin 2l1:Fin 2l2:Fin 2r0:Fin 2hv:validState (↑q) l2 l1 l0 h r0 = trueL:PAM MR:PAM Mhl0:L % 2 = ↑↑l0hl1:L / 2 % 2 = ↑↑l1hl2:L / 2 / 2 % 2 = ↑↑l2hr0:R % 2 = ↑↑r0hx1:fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R))hx2:fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R))hb0:L.mBit = l0⊢ ∃ c₁ c₂, fx₁ a = mEncodeCfg c₁ ∧ fx₂ a = mEncodeCfg c₂ ∧ MRel c₁ c₂
have hb1 : mBit (mHalf L) = l1 := (mBit_eq_iff_mod_eq (L / 2) l1).mpr hl1 mp M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂htuple:∀ (q : Fin 393) (h l0 l1 l2 r0 : Fin 2),
PADefN k fun a ↦
validState (↑q) l2 l1 l0 h r0 = true ∧
∃ L R,
L % 2 = ↑↑l0 ∧
L / 2 % 2 = ↑↑l1 ∧
L / 2 / 2 % 2 = ↑↑l2 ∧
R % 2 = ↑↑r0 ∧
fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R))a:Fin k → PAM Mq:Fin 393h:Fin 2l0:Fin 2l1:Fin 2l2:Fin 2r0:Fin 2hv:validState (↑q) l2 l1 l0 h r0 = trueL:PAM MR:PAM Mhl0:L % 2 = ↑↑l0hl1:L / 2 % 2 = ↑↑l1hl2:L / 2 / 2 % 2 = ↑↑l2hr0:R % 2 = ↑↑r0hx1:fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R))hx2:fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R))hb0:L.mBit = l0hb1:L.mHalf.mBit = l1⊢ ∃ c₁ c₂, fx₁ a = mEncodeCfg c₁ ∧ fx₂ a = mEncodeCfg c₂ ∧ MRel c₁ c₂
have hb2 : mBit (mHalf (mHalf L)) = l2 := (mBit_eq_iff_mod_eq ((L / 2) / 2) l2).mpr hl2 mp M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂htuple:∀ (q : Fin 393) (h l0 l1 l2 r0 : Fin 2),
PADefN k fun a ↦
validState (↑q) l2 l1 l0 h r0 = true ∧
∃ L R,
L % 2 = ↑↑l0 ∧
L / 2 % 2 = ↑↑l1 ∧
L / 2 / 2 % 2 = ↑↑l2 ∧
R % 2 = ↑↑r0 ∧
fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R))a:Fin k → PAM Mq:Fin 393h:Fin 2l0:Fin 2l1:Fin 2l2:Fin 2r0:Fin 2hv:validState (↑q) l2 l1 l0 h r0 = trueL:PAM MR:PAM Mhl0:L % 2 = ↑↑l0hl1:L / 2 % 2 = ↑↑l1hl2:L / 2 / 2 % 2 = ↑↑l2hr0:R % 2 = ↑↑r0hx1:fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R))hx2:fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R))hb0:L.mBit = l0hb1:L.mHalf.mBit = l1hb2:L.mHalf.mHalf.mBit = l2⊢ ∃ c₁ c₂, fx₁ a = mEncodeCfg c₁ ∧ fx₂ a = mEncodeCfg c₂ ∧ MRel c₁ c₂
have hbr : mBit R = r0 := (mBit_eq_iff_mod_eq R r0).mpr hr0 mp M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂htuple:∀ (q : Fin 393) (h l0 l1 l2 r0 : Fin 2),
PADefN k fun a ↦
validState (↑q) l2 l1 l0 h r0 = true ∧
∃ L R,
L % 2 = ↑↑l0 ∧
L / 2 % 2 = ↑↑l1 ∧
L / 2 / 2 % 2 = ↑↑l2 ∧
R % 2 = ↑↑r0 ∧
fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R))a:Fin k → PAM Mq:Fin 393h:Fin 2l0:Fin 2l1:Fin 2l2:Fin 2r0:Fin 2hv:validState (↑q) l2 l1 l0 h r0 = trueL:PAM MR:PAM Mhl0:L % 2 = ↑↑l0hl1:L / 2 % 2 = ↑↑l1hl2:L / 2 / 2 % 2 = ↑↑l2hr0:R % 2 = ↑↑r0hx1:fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R))hx2:fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R))hb0:L.mBit = l0hb1:L.mHalf.mBit = l1hb2:L.mHalf.mHalf.mBit = l2hbr:R.mBit = r0⊢ ∃ c₁ c₂, fx₁ a = mEncodeCfg c₁ ∧ fx₂ a = mEncodeCfg c₂ ∧ MRel c₁ c₂
refine ⟨⟨q, h, L, R⟩, ⟨mapState q.val l0 h, h, L, R⟩, hx1, hx2, ?_⟩ mp M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂htuple:∀ (q : Fin 393) (h l0 l1 l2 r0 : Fin 2),
PADefN k fun a ↦
validState (↑q) l2 l1 l0 h r0 = true ∧
∃ L R,
L % 2 = ↑↑l0 ∧
L / 2 % 2 = ↑↑l1 ∧
L / 2 / 2 % 2 = ↑↑l2 ∧
R % 2 = ↑↑r0 ∧
fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R))a:Fin k → PAM Mq:Fin 393h:Fin 2l0:Fin 2l1:Fin 2l2:Fin 2r0:Fin 2hv:validState (↑q) l2 l1 l0 h r0 = trueL:PAM MR:PAM Mhl0:L % 2 = ↑↑l0hl1:L / 2 % 2 = ↑↑l1hl2:L / 2 / 2 % 2 = ↑↑l2hr0:R % 2 = ↑↑r0hx1:fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R))hx2:fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R))hb0:L.mBit = l0hb1:L.mHalf.mBit = l1hb2:L.mHalf.mHalf.mBit = l2hbr:R.mBit = r0⊢ MRel { state := q, head := h, left := L, right := R } { state := mapState (↑q) l0 h, head := h, left := L, right := R }
simp only [MRel, hb0, hb1, hb2, hbr, hv, true_and] All goals completed! 🐙
· mpr M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂htuple:∀ (q : Fin 393) (h l0 l1 l2 r0 : Fin 2),
PADefN k fun a ↦
validState (↑q) l2 l1 l0 h r0 = true ∧
∃ L R,
L % 2 = ↑↑l0 ∧
L / 2 % 2 = ↑↑l1 ∧
L / 2 / 2 % 2 = ↑↑l2 ∧
R % 2 = ↑↑r0 ∧
fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R))a:Fin k → PAM M⊢ (∃ c₁ c₂, fx₁ a = mEncodeCfg c₁ ∧ fx₂ a = mEncodeCfg c₂ ∧ MRel c₁ c₂) →
∃ i i_1 i_2 i_3 i_4 i_5,
validState (↑i) i_4 i_3 i_2 i_1 i_5 = true ∧
∃ L R,
L % 2 = ↑↑i_2 ∧
L / 2 % 2 = ↑↑i_3 ∧
L / 2 / 2 % 2 = ↑↑i_4 ∧
R % 2 = ↑↑i_5 ∧
fx₁ a = (↑↑i).mPair ((↑↑i_1).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑i) i_2 i_1)).mPair ((↑↑i_1).mPair (L.mPair R)) rintro ⟨⟨q, h, L, R⟩, c₂, hx1, hx2, hv, rfl⟩ mpr M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mk:ℕfx₁:(Fin k → PAM M) → PAM Mfx₂:(Fin k → PAM M) → PAM Mhx₁:PAFunN k fx₁hx₂:PAFunN k fx₂htuple:∀ (q : Fin 393) (h l0 l1 l2 r0 : Fin 2),
PADefN k fun a ↦
validState (↑q) l2 l1 l0 h r0 = true ∧
∃ L R,
L % 2 = ↑↑l0 ∧
L / 2 % 2 = ↑↑l1 ∧
L / 2 / 2 % 2 = ↑↑l2 ∧
R % 2 = ↑↑r0 ∧
fx₁ a = (↑↑q).mPair ((↑↑h).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑q) l0 h)).mPair ((↑↑h).mPair (L.mPair R))a:Fin k → PAM Mq:Fin 393h:Fin 2L:PAM MR:PAM Mhx1:fx₁ a = mEncodeCfg { state := q, head := h, left := L, right := R }hv:validState ↑{ state := q, head := h, left := L, right := R }.state
{ state := q, head := h, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := h, left := L, right := R }.left.mHalf.mBit
{ state := q, head := h, left := L, right := R }.left.mBit { state := q, head := h, left := L, right := R }.head
{ state := q, head := h, left := L, right := R }.right.mBit =
truehx2:fx₂ a =
mEncodeCfg
{
state :=
mapState ↑{ state := q, head := h, left := L, right := R }.state
{ state := q, head := h, left := L, right := R }.left.mBit
{ state := q, head := h, left := L, right := R }.head,
head := { state := q, head := h, left := L, right := R }.head,
left := { state := q, head := h, left := L, right := R }.left,
right := { state := q, head := h, left := L, right := R }.right }⊢ ∃ i i_1 i_2 i_3 i_4 i_5,
validState (↑i) i_4 i_3 i_2 i_1 i_5 = true ∧
∃ L R,
L % 2 = ↑↑i_2 ∧
L / 2 % 2 = ↑↑i_3 ∧
L / 2 / 2 % 2 = ↑↑i_4 ∧
R % 2 = ↑↑i_5 ∧
fx₁ a = (↑↑i).mPair ((↑↑i_1).mPair (L.mPair R)) ∧
fx₂ a = (↑↑(mapState (↑i) i_2 i_1)).mPair ((↑↑i_1).mPair (L.mPair R))
refine ⟨q, h, mBit L, mBit (mHalf L), mBit (mHalf (mHalf L)), mBit R, hv, L, R,
(mBit_eq_iff_mod_eq L _).mp rfl,
(mBit_eq_iff_mod_eq (L / 2) _).mp rfl,
(mBit_eq_iff_mod_eq ((L / 2) / 2) _).mp rfl,
(mBit_eq_iff_mod_eq R _).mp rfl, hx1, hx2⟩ All goals completed! 🐙private theorem mRel_boot :
MRel (embedCfg (M := M) (cfgOfFast 64 [] 0 bootR_39753))
(embedCfg (M := M) (cfgOfFast 64 [] 0 bootR_39753)) := by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel M⊢ MRel (embedCfg (cfgOfFast 64 [] 0 bootR_39753)) (embedCfg (cfgOfFast 64 [] 0 bootR_39753))
obtain ⟨hv, hmap⟩ := rel_boot M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mhv:validState (↑(cfgOfFast 64 [] 0 bootR_39753).state) (cfgOfFast 64 [] 0 bootR_39753).tape.left.tail.tail.head
(cfgOfFast 64 [] 0 bootR_39753).tape.left.tail.head (cfgOfFast 64 [] 0 bootR_39753).tape.left.head
(cfgOfFast 64 [] 0 bootR_39753).tape.head (cfgOfFast 64 [] 0 bootR_39753).tape.right.head =
truehmap:cfgOfFast 64 [] 0 bootR_39753 =
{
state :=
mapState (↑(cfgOfFast 64 [] 0 bootR_39753).state) (cfgOfFast 64 [] 0 bootR_39753).tape.left.head
(cfgOfFast 64 [] 0 bootR_39753).tape.head,
tape := (cfgOfFast 64 [] 0 bootR_39753).tape }⊢ MRel (embedCfg (cfgOfFast 64 [] 0 bootR_39753)) (embedCfg (cfgOfFast 64 [] 0 bootR_39753))
have hst := congrArg Cfg.state hmap M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mhv:validState (↑(cfgOfFast 64 [] 0 bootR_39753).state) (cfgOfFast 64 [] 0 bootR_39753).tape.left.tail.tail.head
(cfgOfFast 64 [] 0 bootR_39753).tape.left.tail.head (cfgOfFast 64 [] 0 bootR_39753).tape.left.head
(cfgOfFast 64 [] 0 bootR_39753).tape.head (cfgOfFast 64 [] 0 bootR_39753).tape.right.head =
truehmap:cfgOfFast 64 [] 0 bootR_39753 =
{
state :=
mapState (↑(cfgOfFast 64 [] 0 bootR_39753).state) (cfgOfFast 64 [] 0 bootR_39753).tape.left.head
(cfgOfFast 64 [] 0 bootR_39753).tape.head,
tape := (cfgOfFast 64 [] 0 bootR_39753).tape }hst:(cfgOfFast 64 [] 0 bootR_39753).state =
{
state :=
mapState (↑(cfgOfFast 64 [] 0 bootR_39753).state) (cfgOfFast 64 [] 0 bootR_39753).tape.left.head
(cfgOfFast 64 [] 0 bootR_39753).tape.head,
tape := (cfgOfFast 64 [] 0 bootR_39753).tape }.state⊢ MRel (embedCfg (cfgOfFast 64 [] 0 bootR_39753)) (embedCfg (cfgOfFast 64 [] 0 bootR_39753))
dsimp only [cfgOfFast] at hv hst ⊢ M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mhv:validState (↑64)
(Tape.mk' (ListBlank.append [] default)
(ListBlank.cons 0 (ListBlank.append bootR_39753 default))).left.tail.tail.head
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).left.tail.head
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).left.head
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).head
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).right.head =
truehmap:cfgOfFast 64 [] 0 bootR_39753 =
{
state :=
mapState (↑(cfgOfFast 64 [] 0 bootR_39753).state) (cfgOfFast 64 [] 0 bootR_39753).tape.left.head
(cfgOfFast 64 [] 0 bootR_39753).tape.head,
tape := (cfgOfFast 64 [] 0 bootR_39753).tape }hst:64 =
mapState (↑64)
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).left.head
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).head⊢ MRel
(embedCfg
{ state := 64,
tape := Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default)) })
(embedCfg
{ state := 64,
tape := Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default)) })
simp only [MRel, embedCfg, mHalf_embedHalf, mBit_embedHalf] M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mhv:validState (↑64)
(Tape.mk' (ListBlank.append [] default)
(ListBlank.cons 0 (ListBlank.append bootR_39753 default))).left.tail.tail.head
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).left.tail.head
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).left.head
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).head
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).right.head =
truehmap:cfgOfFast 64 [] 0 bootR_39753 =
{
state :=
mapState (↑(cfgOfFast 64 [] 0 bootR_39753).state) (cfgOfFast 64 [] 0 bootR_39753).tape.left.head
(cfgOfFast 64 [] 0 bootR_39753).tape.head,
tape := (cfgOfFast 64 [] 0 bootR_39753).tape }hst:64 =
mapState (↑64)
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).left.head
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).head⊢ validState (↑64)
(Tape.mk' (ListBlank.append [] default)
(ListBlank.cons 0 (ListBlank.append bootR_39753 default))).left.tail.tail.head
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).left.tail.head
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).left.head
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).head
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).right.head =
true ∧
{ state := 64,
head := (Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).head,
left :=
embedHalf
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).left,
right :=
embedHalf
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).right } =
{
state :=
mapState (↑64)
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).left.head
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).head,
head := (Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).head,
left :=
embedHalf
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).left,
right :=
embedHalf
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).right }
exact ⟨hv, by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mhv:validState (↑64)
(Tape.mk' (ListBlank.append [] default)
(ListBlank.cons 0 (ListBlank.append bootR_39753 default))).left.tail.tail.head
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).left.tail.head
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).left.head
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).head
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).right.head =
truehmap:cfgOfFast 64 [] 0 bootR_39753 =
{
state :=
mapState (↑(cfgOfFast 64 [] 0 bootR_39753).state) (cfgOfFast 64 [] 0 bootR_39753).tape.left.head
(cfgOfFast 64 [] 0 bootR_39753).tape.head,
tape := (cfgOfFast 64 [] 0 bootR_39753).tape }hst:64 =
mapState (↑64)
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).left.head
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).head⊢ { state := 64,
head := (Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).head,
left :=
embedHalf (Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).left,
right :=
embedHalf
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).right } =
{
state :=
mapState (↑64)
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).left.head
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).head,
head := (Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).head,
left :=
embedHalf (Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).left,
right :=
embedHalf
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).right } rw [← hst M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mhv:validState (↑64)
(Tape.mk' (ListBlank.append [] default)
(ListBlank.cons 0 (ListBlank.append bootR_39753 default))).left.tail.tail.head
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).left.tail.head
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).left.head
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).head
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).right.head =
truehmap:cfgOfFast 64 [] 0 bootR_39753 =
{
state :=
mapState (↑(cfgOfFast 64 [] 0 bootR_39753).state) (cfgOfFast 64 [] 0 bootR_39753).tape.left.head
(cfgOfFast 64 [] 0 bootR_39753).tape.head,
tape := (cfgOfFast 64 [] 0 bootR_39753).tape }hst:64 =
mapState (↑64)
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).left.head
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).head⊢ { state := 64,
head := (Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).head,
left :=
embedHalf (Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).left,
right :=
embedHalf
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).right } =
{ state := 64,
head := (Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).head,
left :=
embedHalf (Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).left,
right :=
embedHalf
(Tape.mk' (ListBlank.append [] default) (ListBlank.cons 0 (ListBlank.append bootR_39753 default))).right }] All goals completed! 🐙⟩private theorem mStep_of_transition_eq {q : Fin 393} {S : Fin 380} (h : Fin 2) (L R : PAM M)
(htr : zf380Trans S.val h =
expectedTransition q.val (mBit (mHalf L)) (mBit L) h (mBit R)) :
mStep candM ⟨S, h, L, R⟩ =
(mStep refM ⟨q, h, L, R⟩).map fun c ↦
⟨mapState c.state.val (mBit c.left) c.head, c.head, c.left, c.right⟩ := by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393S:Fin 380h:Fin 2L:PAM MR:PAM Mhtr:zf380Trans (↑S) h = expectedTransition (↑q) L.mHalf.mBit L.mBit h R.mBit⊢ mStep candM { state := S, head := h, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(mStep refM { state := q, head := h, left := L, right := R })
dsimp only [mStep] M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393S:Fin 380h:Fin 2L:PAM MR:PAM Mhtr:zf380Trans (↑S) h = expectedTransition (↑q) L.mHalf.mBit L.mBit h R.mBit⊢ (match candM.transition S h with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R }) =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(match refM.transition q h with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R })
rw [candM_transition_eq_nat S h, M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393S:Fin 380h:Fin 2L:PAM MR:PAM Mhtr:zf380Trans (↑S) h = expectedTransition (↑q) L.mHalf.mBit L.mBit h R.mBit⊢ (match zf380Trans (↑S) h with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R }) =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(match refM.transition q h with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R }) htr, M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393S:Fin 380h:Fin 2L:PAM MR:PAM Mhtr:zf380Trans (↑S) h = expectedTransition (↑q) L.mHalf.mBit L.mBit h R.mBit⊢ (match expectedTransition (↑q) L.mHalf.mBit L.mBit h R.mBit with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R }) =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(match refM.transition q h with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R }) ConjectureMachines.Zf393.zf393Trans_eq q h M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393S:Fin 380h:Fin 2L:PAM MR:PAM Mhtr:zf380Trans (↑S) h = expectedTransition (↑q) L.mHalf.mBit L.mBit h R.mBit⊢ (match expectedTransition (↑q) L.mHalf.mBit L.mBit h R.mBit with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R }) =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(match Zf393.zf393Trans q h with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R })] M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393S:Fin 380h:Fin 2L:PAM MR:PAM Mhtr:zf380Trans (↑S) h = expectedTransition (↑q) L.mHalf.mBit L.mBit h R.mBit⊢ (match expectedTransition (↑q) L.mHalf.mBit L.mBit h R.mBit with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R }) =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(match Zf393.zf393Trans q h with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R })
rcases e : ConjectureMachines.Zf393.zf393Trans q h with _ | ⟨w, d, q'⟩ none M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393S:Fin 380h:Fin 2L:PAM MR:PAM Mhtr:zf380Trans (↑S) h = expectedTransition (↑q) L.mHalf.mBit L.mBit h R.mBite:Zf393.zf393Trans q h = none⊢ (match expectedTransition (↑q) L.mHalf.mBit L.mBit h R.mBit with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R }) =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(match none with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R })some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393S:Fin 380h:Fin 2L:PAM MR:PAM Mhtr:zf380Trans (↑S) h = expectedTransition (↑q) L.mHalf.mBit L.mBit h R.mBitw:Fin 2d:Dirq':Fin 393e:Zf393.zf393Trans q h = some (w, d, q')⊢ (match expectedTransition (↑q) L.mHalf.mBit L.mBit h R.mBit with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R }) =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(match some (w, d, q') with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R })
· none M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393S:Fin 380h:Fin 2L:PAM MR:PAM Mhtr:zf380Trans (↑S) h = expectedTransition (↑q) L.mHalf.mBit L.mBit h R.mBite:Zf393.zf393Trans q h = none⊢ (match expectedTransition (↑q) L.mHalf.mBit L.mBit h R.mBit with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R }) =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(match none with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R }) simp [expectedTransition, Nat.mod_eq_of_lt q.isLt, e] All goals completed! 🐙
· some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393S:Fin 380h:Fin 2L:PAM MR:PAM Mhtr:zf380Trans (↑S) h = expectedTransition (↑q) L.mHalf.mBit L.mBit h R.mBitw:Fin 2d:Dirq':Fin 393e:Zf393.zf393Trans q h = some (w, d, q')⊢ (match expectedTransition (↑q) L.mHalf.mBit L.mBit h R.mBit with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R }) =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(match some (w, d, q') with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R }) cases d some.left M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393S:Fin 380h:Fin 2L:PAM MR:PAM Mhtr:zf380Trans (↑S) h = expectedTransition (↑q) L.mHalf.mBit L.mBit h R.mBitw:Fin 2q':Fin 393e:Zf393.zf393Trans q h = some (w, Dir.left, q')⊢ (match expectedTransition (↑q) L.mHalf.mBit L.mBit h R.mBit with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R }) =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(match some (w, Dir.left, q') with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R })some.right M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393S:Fin 380h:Fin 2L:PAM MR:PAM Mhtr:zf380Trans (↑S) h = expectedTransition (↑q) L.mHalf.mBit L.mBit h R.mBitw:Fin 2q':Fin 393e:Zf393.zf393Trans q h = some (w, Dir.right, q')⊢ (match expectedTransition (↑q) L.mHalf.mBit L.mBit h R.mBit with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R }) =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(match some (w, Dir.right, q') with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R }) <;> some.left M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393S:Fin 380h:Fin 2L:PAM MR:PAM Mhtr:zf380Trans (↑S) h = expectedTransition (↑q) L.mHalf.mBit L.mBit h R.mBitw:Fin 2q':Fin 393e:Zf393.zf393Trans q h = some (w, Dir.left, q')⊢ (match expectedTransition (↑q) L.mHalf.mBit L.mBit h R.mBit with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R }) =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(match some (w, Dir.left, q') with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R })some.right M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393S:Fin 380h:Fin 2L:PAM MR:PAM Mhtr:zf380Trans (↑S) h = expectedTransition (↑q) L.mHalf.mBit L.mBit h R.mBitw:Fin 2q':Fin 393e:Zf393.zf393Trans q h = some (w, Dir.right, q')⊢ (match expectedTransition (↑q) L.mHalf.mBit L.mBit h R.mBit with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R }) =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(match some (w, Dir.right, q') with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R }) simp [expectedTransition, Nat.mod_eq_of_lt q.isLt, e] All goals completed! 🐙private theorem mStep_lr_pair {q₁ P S : Fin 380} (h : Fin 2) (L R : PAM M)
(h1 : zf380Trans q₁.val h = some (h, Dir.left, P))
(h2 : zf380Trans P.val (mBit L) = some (mBit L, Dir.right, S)) :
mNSteps candM 2 ⟨q₁, h, L, R⟩ = some ⟨S, h, L, R⟩ := by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P:Fin 380S:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P)h2:zf380Trans (↑P) L.mBit = some (L.mBit, Dir.right, S)⊢ mNSteps candM 2 { state := q₁, head := h, left := L, right := R } =
some { state := S, head := h, left := L, right := R }
have hs1 : mStep candM ⟨q₁, h, L, R⟩ = some ⟨P, mBit L, mHalf L, mCons h R⟩ := by
simp [mStep, candM_transition_eq_nat, h1] M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P:Fin 380S:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P)h2:zf380Trans (↑P) L.mBit = some (L.mBit, Dir.right, S)hs1:mStep candM { state := q₁, head := h, left := L, right := R } =
some { state := P, head := L.mBit, left := L.mHalf, right := mCons h R }⊢ mNSteps candM 2 { state := q₁, head := h, left := L, right := R } =
some { state := S, head := h, left := L, right := R }
have hs2 : mStep candM ⟨P, mBit L, mHalf L, mCons h R⟩ = some ⟨S, h, L, R⟩ := by
simp [mStep, candM_transition_eq_nat, h2] M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P:Fin 380S:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P)h2:zf380Trans (↑P) L.mBit = some (L.mBit, Dir.right, S)hs1:mStep candM { state := q₁, head := h, left := L, right := R } =
some { state := P, head := L.mBit, left := L.mHalf, right := mCons h R }hs2:mStep candM { state := P, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S, head := h, left := L, right := R }⊢ mNSteps candM 2 { state := q₁, head := h, left := L, right := R } =
some { state := S, head := h, left := L, right := R }
simp [mNSteps, hs1, hs2] All goals completed! 🐙private theorem mStep_three_left_right {q₁ P S : Fin 380} {h : Fin 2} {L R : PAM M}
(h1 : zf380Trans q₁.val h = some (h, Dir.left, P))
(h2 : zf380Trans P.val (mBit L) = some (mBit L, Dir.right, S))
{c' : MCfg 380 M} (h3 : mStep candM ⟨S, h, L, R⟩ = some c') :
mNSteps candM 3 ⟨q₁, h, L, R⟩ = some c' := by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P:Fin 380S:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P)h2:zf380Trans (↑P) L.mBit = some (L.mBit, Dir.right, S)c':MCfg 380 Mh3:mStep candM { state := S, head := h, left := L, right := R } = some c'⊢ mNSteps candM 3 { state := q₁, head := h, left := L, right := R } = some c'
rw [show (3 : ℕ) = 2 + 1 from rfl, M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P:Fin 380S:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P)h2:zf380Trans (↑P) L.mBit = some (L.mBit, Dir.right, S)c':MCfg 380 Mh3:mStep candM { state := S, head := h, left := L, right := R } = some c'⊢ mNSteps candM (2 + 1) { state := q₁, head := h, left := L, right := R } = some c' mNSteps_add, M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P:Fin 380S:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P)h2:zf380Trans (↑P) L.mBit = some (L.mBit, Dir.right, S)c':MCfg 380 Mh3:mStep candM { state := S, head := h, left := L, right := R } = some c'⊢ (mNSteps candM 2 { state := q₁, head := h, left := L, right := R }).bind (mNSteps candM 1) = some c' mStep_lr_pair h L R h1 h2 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P:Fin 380S:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P)h2:zf380Trans (↑P) L.mBit = some (L.mBit, Dir.right, S)c':MCfg 380 Mh3:mStep candM { state := S, head := h, left := L, right := R } = some c'⊢ (some { state := S, head := h, left := L, right := R }).bind (mNSteps candM 1) = some c'] M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P:Fin 380S:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P)h2:zf380Trans (↑P) L.mBit = some (L.mBit, Dir.right, S)c':MCfg 380 Mh3:mStep candM { state := S, head := h, left := L, right := R } = some c'⊢ (some { state := S, head := h, left := L, right := R }).bind (mNSteps candM 1) = some c'
simpa [mNSteps] using h3 All goals completed! 🐙private theorem mStep_five_left_right {q₁ P₁ S₁ P₂ S₂ : Fin 380} {h : Fin 2} {L R : PAM M}
(h1 : zf380Trans q₁.val h = some (h, Dir.left, P₁))
(h2 : zf380Trans P₁.val (mBit L) = some (mBit L, Dir.right, S₁))
(h3 : zf380Trans S₁.val h = some (h, Dir.left, P₂))
(h4 : zf380Trans P₂.val (mBit L) = some (mBit L, Dir.right, S₂))
{c' : MCfg 380 M} (h5 : mStep candM ⟨S₂, h, L, R⟩ = some c') :
mNSteps candM 5 ⟨q₁, h, L, R⟩ = some c' := by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P₁:Fin 380S₁:Fin 380P₂:Fin 380S₂:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P₁)h2:zf380Trans (↑P₁) L.mBit = some (L.mBit, Dir.right, S₁)h3:zf380Trans (↑S₁) h = some (h, Dir.left, P₂)h4:zf380Trans (↑P₂) L.mBit = some (L.mBit, Dir.right, S₂)c':MCfg 380 Mh5:mStep candM { state := S₂, head := h, left := L, right := R } = some c'⊢ mNSteps candM 5 { state := q₁, head := h, left := L, right := R } = some c'
rw [show (5 : ℕ) = 2 + 3 from rfl, M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P₁:Fin 380S₁:Fin 380P₂:Fin 380S₂:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P₁)h2:zf380Trans (↑P₁) L.mBit = some (L.mBit, Dir.right, S₁)h3:zf380Trans (↑S₁) h = some (h, Dir.left, P₂)h4:zf380Trans (↑P₂) L.mBit = some (L.mBit, Dir.right, S₂)c':MCfg 380 Mh5:mStep candM { state := S₂, head := h, left := L, right := R } = some c'⊢ mNSteps candM (2 + 3) { state := q₁, head := h, left := L, right := R } = some c' mNSteps_add, M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P₁:Fin 380S₁:Fin 380P₂:Fin 380S₂:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P₁)h2:zf380Trans (↑P₁) L.mBit = some (L.mBit, Dir.right, S₁)h3:zf380Trans (↑S₁) h = some (h, Dir.left, P₂)h4:zf380Trans (↑P₂) L.mBit = some (L.mBit, Dir.right, S₂)c':MCfg 380 Mh5:mStep candM { state := S₂, head := h, left := L, right := R } = some c'⊢ (mNSteps candM 2 { state := q₁, head := h, left := L, right := R }).bind (mNSteps candM 3) = some c' mStep_lr_pair h L R h1 h2 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P₁:Fin 380S₁:Fin 380P₂:Fin 380S₂:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P₁)h2:zf380Trans (↑P₁) L.mBit = some (L.mBit, Dir.right, S₁)h3:zf380Trans (↑S₁) h = some (h, Dir.left, P₂)h4:zf380Trans (↑P₂) L.mBit = some (L.mBit, Dir.right, S₂)c':MCfg 380 Mh5:mStep candM { state := S₂, head := h, left := L, right := R } = some c'⊢ (some { state := S₁, head := h, left := L, right := R }).bind (mNSteps candM 3) = some c'] M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P₁:Fin 380S₁:Fin 380P₂:Fin 380S₂:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P₁)h2:zf380Trans (↑P₁) L.mBit = some (L.mBit, Dir.right, S₁)h3:zf380Trans (↑S₁) h = some (h, Dir.left, P₂)h4:zf380Trans (↑P₂) L.mBit = some (L.mBit, Dir.right, S₂)c':MCfg 380 Mh5:mStep candM { state := S₂, head := h, left := L, right := R } = some c'⊢ (some { state := S₁, head := h, left := L, right := R }).bind (mNSteps candM 3) = some c'
exact mStep_three_left_right h3 h4 h5 All goals completed! 🐙private theorem mStep_five_left_left_right_right {q₁ P₁ P₂ S₁ S₂ : Fin 380}
{h : Fin 2} {L R : PAM M}
(h1 : zf380Trans q₁.val h = some (h, Dir.left, P₁))
(h2 : zf380Trans P₁.val (mBit L) = some (mBit L, Dir.left, P₂))
(h3 : zf380Trans P₂.val (mBit (mHalf L)) = some (mBit (mHalf L), Dir.right, S₁))
(h4 : zf380Trans S₁.val (mBit L) = some (mBit L, Dir.right, S₂))
{c' : MCfg 380 M} (h5 : mStep candM ⟨S₂, h, L, R⟩ = some c') :
mNSteps candM 5 ⟨q₁, h, L, R⟩ = some c' := by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P₁:Fin 380P₂:Fin 380S₁:Fin 380S₂:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P₁)h2:zf380Trans (↑P₁) L.mBit = some (L.mBit, Dir.left, P₂)h3:zf380Trans (↑P₂) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, S₁)h4:zf380Trans (↑S₁) L.mBit = some (L.mBit, Dir.right, S₂)c':MCfg 380 Mh5:mStep candM { state := S₂, head := h, left := L, right := R } = some c'⊢ mNSteps candM 5 { state := q₁, head := h, left := L, right := R } = some c'
have hs1 : mStep candM ⟨q₁, h, L, R⟩ = some ⟨P₁, mBit L, mHalf L, mCons h R⟩ := by
simp [mStep, candM_transition_eq_nat, h1] M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P₁:Fin 380P₂:Fin 380S₁:Fin 380S₂:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P₁)h2:zf380Trans (↑P₁) L.mBit = some (L.mBit, Dir.left, P₂)h3:zf380Trans (↑P₂) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, S₁)h4:zf380Trans (↑S₁) L.mBit = some (L.mBit, Dir.right, S₂)c':MCfg 380 Mh5:mStep candM { state := S₂, head := h, left := L, right := R } = some c'hs1:mStep candM { state := q₁, head := h, left := L, right := R } =
some { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R }⊢ mNSteps candM 5 { state := q₁, head := h, left := L, right := R } = some c'
have hs23 := mStep_lr_pair (mBit L) (mHalf L) (mCons h R) h2 h3 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P₁:Fin 380P₂:Fin 380S₁:Fin 380S₂:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P₁)h2:zf380Trans (↑P₁) L.mBit = some (L.mBit, Dir.left, P₂)h3:zf380Trans (↑P₂) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, S₁)h4:zf380Trans (↑S₁) L.mBit = some (L.mBit, Dir.right, S₂)c':MCfg 380 Mh5:mStep candM { state := S₂, head := h, left := L, right := R } = some c'hs1:mStep candM { state := q₁, head := h, left := L, right := R } =
some { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R }hs23:mNSteps candM 2 { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₁, head := L.mBit, left := L.mHalf, right := mCons h R }⊢ mNSteps candM 5 { state := q₁, head := h, left := L, right := R } = some c'
have hs4 : mStep candM ⟨S₁, mBit L, mHalf L, mCons h R⟩ = some ⟨S₂, h, L, R⟩ := by
simp [mStep, candM_transition_eq_nat, h4] M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P₁:Fin 380P₂:Fin 380S₁:Fin 380S₂:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P₁)h2:zf380Trans (↑P₁) L.mBit = some (L.mBit, Dir.left, P₂)h3:zf380Trans (↑P₂) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, S₁)h4:zf380Trans (↑S₁) L.mBit = some (L.mBit, Dir.right, S₂)c':MCfg 380 Mh5:mStep candM { state := S₂, head := h, left := L, right := R } = some c'hs1:mStep candM { state := q₁, head := h, left := L, right := R } =
some { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R }hs23:mNSteps candM 2 { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₁, head := L.mBit, left := L.mHalf, right := mCons h R }hs4:mStep candM { state := S₁, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₂, head := h, left := L, right := R }⊢ mNSteps candM 5 { state := q₁, head := h, left := L, right := R } = some c'
rw [show (5 : ℕ) = 1 + (2 + (1 + 1)) from rfl, M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P₁:Fin 380P₂:Fin 380S₁:Fin 380S₂:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P₁)h2:zf380Trans (↑P₁) L.mBit = some (L.mBit, Dir.left, P₂)h3:zf380Trans (↑P₂) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, S₁)h4:zf380Trans (↑S₁) L.mBit = some (L.mBit, Dir.right, S₂)c':MCfg 380 Mh5:mStep candM { state := S₂, head := h, left := L, right := R } = some c'hs1:mStep candM { state := q₁, head := h, left := L, right := R } =
some { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R }hs23:mNSteps candM 2 { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₁, head := L.mBit, left := L.mHalf, right := mCons h R }hs4:mStep candM { state := S₁, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₂, head := h, left := L, right := R }⊢ mNSteps candM (1 + (2 + (1 + 1))) { state := q₁, head := h, left := L, right := R } = some c' mNSteps_add, M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P₁:Fin 380P₂:Fin 380S₁:Fin 380S₂:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P₁)h2:zf380Trans (↑P₁) L.mBit = some (L.mBit, Dir.left, P₂)h3:zf380Trans (↑P₂) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, S₁)h4:zf380Trans (↑S₁) L.mBit = some (L.mBit, Dir.right, S₂)c':MCfg 380 Mh5:mStep candM { state := S₂, head := h, left := L, right := R } = some c'hs1:mStep candM { state := q₁, head := h, left := L, right := R } =
some { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R }hs23:mNSteps candM 2 { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₁, head := L.mBit, left := L.mHalf, right := mCons h R }hs4:mStep candM { state := S₁, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₂, head := h, left := L, right := R }⊢ (mNSteps candM 1 { state := q₁, head := h, left := L, right := R }).bind (mNSteps candM (2 + (1 + 1))) = some c'
show mNSteps candM 1 ⟨q₁, h, L, R⟩ = some ⟨P₁, mBit L, mHalf L, mCons h R⟩ by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P₁:Fin 380P₂:Fin 380S₁:Fin 380S₂:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P₁)h2:zf380Trans (↑P₁) L.mBit = some (L.mBit, Dir.left, P₂)h3:zf380Trans (↑P₂) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, S₁)h4:zf380Trans (↑S₁) L.mBit = some (L.mBit, Dir.right, S₂)c':MCfg 380 Mh5:mStep candM { state := S₂, head := h, left := L, right := R } = some c'⊢ mNSteps candM 5 { state := q₁, head := h, left := L, right := R } = some c'
simpa [mNSteps] using hs1 All goals completed! 🐙] M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P₁:Fin 380P₂:Fin 380S₁:Fin 380S₂:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P₁)h2:zf380Trans (↑P₁) L.mBit = some (L.mBit, Dir.left, P₂)h3:zf380Trans (↑P₂) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, S₁)h4:zf380Trans (↑S₁) L.mBit = some (L.mBit, Dir.right, S₂)c':MCfg 380 Mh5:mStep candM { state := S₂, head := h, left := L, right := R } = some c'hs1:mStep candM { state := q₁, head := h, left := L, right := R } =
some { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R }hs23:mNSteps candM 2 { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₁, head := L.mBit, left := L.mHalf, right := mCons h R }hs4:mStep candM { state := S₁, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₂, head := h, left := L, right := R }⊢ (some { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R }).bind (mNSteps candM (2 + (1 + 1))) = some c'
dsimp only [Option.bind] M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P₁:Fin 380P₂:Fin 380S₁:Fin 380S₂:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P₁)h2:zf380Trans (↑P₁) L.mBit = some (L.mBit, Dir.left, P₂)h3:zf380Trans (↑P₂) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, S₁)h4:zf380Trans (↑S₁) L.mBit = some (L.mBit, Dir.right, S₂)c':MCfg 380 Mh5:mStep candM { state := S₂, head := h, left := L, right := R } = some c'hs1:mStep candM { state := q₁, head := h, left := L, right := R } =
some { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R }hs23:mNSteps candM 2 { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₁, head := L.mBit, left := L.mHalf, right := mCons h R }hs4:mStep candM { state := S₁, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₂, head := h, left := L, right := R }⊢ mNSteps candM (2 + (1 + 1)) { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R } = some c'
rw [mNSteps_add, M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P₁:Fin 380P₂:Fin 380S₁:Fin 380S₂:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P₁)h2:zf380Trans (↑P₁) L.mBit = some (L.mBit, Dir.left, P₂)h3:zf380Trans (↑P₂) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, S₁)h4:zf380Trans (↑S₁) L.mBit = some (L.mBit, Dir.right, S₂)c':MCfg 380 Mh5:mStep candM { state := S₂, head := h, left := L, right := R } = some c'hs1:mStep candM { state := q₁, head := h, left := L, right := R } =
some { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R }hs23:mNSteps candM 2 { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₁, head := L.mBit, left := L.mHalf, right := mCons h R }hs4:mStep candM { state := S₁, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₂, head := h, left := L, right := R }⊢ (mNSteps candM 2 { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R }).bind (mNSteps candM (1 + 1)) =
some c' hs23 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P₁:Fin 380P₂:Fin 380S₁:Fin 380S₂:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P₁)h2:zf380Trans (↑P₁) L.mBit = some (L.mBit, Dir.left, P₂)h3:zf380Trans (↑P₂) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, S₁)h4:zf380Trans (↑S₁) L.mBit = some (L.mBit, Dir.right, S₂)c':MCfg 380 Mh5:mStep candM { state := S₂, head := h, left := L, right := R } = some c'hs1:mStep candM { state := q₁, head := h, left := L, right := R } =
some { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R }hs23:mNSteps candM 2 { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₁, head := L.mBit, left := L.mHalf, right := mCons h R }hs4:mStep candM { state := S₁, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₂, head := h, left := L, right := R }⊢ (some { state := S₁, head := L.mBit, left := L.mHalf, right := mCons h R }).bind (mNSteps candM (1 + 1)) = some c'] M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P₁:Fin 380P₂:Fin 380S₁:Fin 380S₂:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P₁)h2:zf380Trans (↑P₁) L.mBit = some (L.mBit, Dir.left, P₂)h3:zf380Trans (↑P₂) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, S₁)h4:zf380Trans (↑S₁) L.mBit = some (L.mBit, Dir.right, S₂)c':MCfg 380 Mh5:mStep candM { state := S₂, head := h, left := L, right := R } = some c'hs1:mStep candM { state := q₁, head := h, left := L, right := R } =
some { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R }hs23:mNSteps candM 2 { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₁, head := L.mBit, left := L.mHalf, right := mCons h R }hs4:mStep candM { state := S₁, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₂, head := h, left := L, right := R }⊢ (some { state := S₁, head := L.mBit, left := L.mHalf, right := mCons h R }).bind (mNSteps candM (1 + 1)) = some c'
dsimp only [Option.bind] M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P₁:Fin 380P₂:Fin 380S₁:Fin 380S₂:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P₁)h2:zf380Trans (↑P₁) L.mBit = some (L.mBit, Dir.left, P₂)h3:zf380Trans (↑P₂) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, S₁)h4:zf380Trans (↑S₁) L.mBit = some (L.mBit, Dir.right, S₂)c':MCfg 380 Mh5:mStep candM { state := S₂, head := h, left := L, right := R } = some c'hs1:mStep candM { state := q₁, head := h, left := L, right := R } =
some { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R }hs23:mNSteps candM 2 { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₁, head := L.mBit, left := L.mHalf, right := mCons h R }hs4:mStep candM { state := S₁, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₂, head := h, left := L, right := R }⊢ mNSteps candM (1 + 1) { state := S₁, head := L.mBit, left := L.mHalf, right := mCons h R } = some c'
simp [mNSteps, hs4, h5] All goals completed! 🐙private theorem mStep_seven_left_left_left_right_right_right
{q₁ P₁ P₂ P₃ S₁ S₂ S₃ : Fin 380} {h : Fin 2} {L R : PAM M}
(h1 : zf380Trans q₁.val h = some (h, Dir.left, P₁))
(h2 : zf380Trans P₁.val (mBit L) = some (mBit L, Dir.left, P₂))
(h3 : zf380Trans P₂.val (mBit (mHalf L)) = some (mBit (mHalf L), Dir.left, P₃))
(h4 : zf380Trans P₃.val (mBit (mHalf (mHalf L))) =
some (mBit (mHalf (mHalf L)), Dir.right, S₁))
(h5 : zf380Trans S₁.val (mBit (mHalf L)) = some (mBit (mHalf L), Dir.right, S₂))
(h6 : zf380Trans S₂.val (mBit L) = some (mBit L, Dir.right, S₃))
{c' : MCfg 380 M} (h7 : mStep candM ⟨S₃, h, L, R⟩ = some c') :
mNSteps candM 7 ⟨q₁, h, L, R⟩ = some c' := by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P₁:Fin 380P₂:Fin 380P₃:Fin 380S₁:Fin 380S₂:Fin 380S₃:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P₁)h2:zf380Trans (↑P₁) L.mBit = some (L.mBit, Dir.left, P₂)h3:zf380Trans (↑P₂) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, P₃)h4:zf380Trans (↑P₃) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, S₁)h5:zf380Trans (↑S₁) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, S₂)h6:zf380Trans (↑S₂) L.mBit = some (L.mBit, Dir.right, S₃)c':MCfg 380 Mh7:mStep candM { state := S₃, head := h, left := L, right := R } = some c'⊢ mNSteps candM 7 { state := q₁, head := h, left := L, right := R } = some c'
have hs1 : mStep candM ⟨q₁, h, L, R⟩ = some ⟨P₁, mBit L, mHalf L, mCons h R⟩ := by
simp [mStep, candM_transition_eq_nat, h1] M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P₁:Fin 380P₂:Fin 380P₃:Fin 380S₁:Fin 380S₂:Fin 380S₃:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P₁)h2:zf380Trans (↑P₁) L.mBit = some (L.mBit, Dir.left, P₂)h3:zf380Trans (↑P₂) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, P₃)h4:zf380Trans (↑P₃) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, S₁)h5:zf380Trans (↑S₁) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, S₂)h6:zf380Trans (↑S₂) L.mBit = some (L.mBit, Dir.right, S₃)c':MCfg 380 Mh7:mStep candM { state := S₃, head := h, left := L, right := R } = some c'hs1:mStep candM { state := q₁, head := h, left := L, right := R } =
some { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R }⊢ mNSteps candM 7 { state := q₁, head := h, left := L, right := R } = some c'
have hs6 : mStep candM ⟨S₂, mBit L, mHalf L, mCons h R⟩ = some ⟨S₃, h, L, R⟩ := by
simp [mStep, candM_transition_eq_nat, h6] M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P₁:Fin 380P₂:Fin 380P₃:Fin 380S₁:Fin 380S₂:Fin 380S₃:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P₁)h2:zf380Trans (↑P₁) L.mBit = some (L.mBit, Dir.left, P₂)h3:zf380Trans (↑P₂) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, P₃)h4:zf380Trans (↑P₃) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, S₁)h5:zf380Trans (↑S₁) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, S₂)h6:zf380Trans (↑S₂) L.mBit = some (L.mBit, Dir.right, S₃)c':MCfg 380 Mh7:mStep candM { state := S₃, head := h, left := L, right := R } = some c'hs1:mStep candM { state := q₁, head := h, left := L, right := R } =
some { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R }hs6:mStep candM { state := S₂, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₃, head := h, left := L, right := R }⊢ mNSteps candM 7 { state := q₁, head := h, left := L, right := R } = some c'
have hmid := mStep_five_left_left_right_right
(L := mHalf L) (R := mCons h R) h2 h3 h4 h5 hs6 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P₁:Fin 380P₂:Fin 380P₃:Fin 380S₁:Fin 380S₂:Fin 380S₃:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P₁)h2:zf380Trans (↑P₁) L.mBit = some (L.mBit, Dir.left, P₂)h3:zf380Trans (↑P₂) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, P₃)h4:zf380Trans (↑P₃) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, S₁)h5:zf380Trans (↑S₁) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, S₂)h6:zf380Trans (↑S₂) L.mBit = some (L.mBit, Dir.right, S₃)c':MCfg 380 Mh7:mStep candM { state := S₃, head := h, left := L, right := R } = some c'hs1:mStep candM { state := q₁, head := h, left := L, right := R } =
some { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R }hs6:mStep candM { state := S₂, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₃, head := h, left := L, right := R }hmid:mNSteps candM 5 { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₃, head := h, left := L, right := R }⊢ mNSteps candM 7 { state := q₁, head := h, left := L, right := R } = some c'
rw [show (7 : ℕ) = 1 + (5 + 1) from rfl, M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P₁:Fin 380P₂:Fin 380P₃:Fin 380S₁:Fin 380S₂:Fin 380S₃:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P₁)h2:zf380Trans (↑P₁) L.mBit = some (L.mBit, Dir.left, P₂)h3:zf380Trans (↑P₂) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, P₃)h4:zf380Trans (↑P₃) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, S₁)h5:zf380Trans (↑S₁) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, S₂)h6:zf380Trans (↑S₂) L.mBit = some (L.mBit, Dir.right, S₃)c':MCfg 380 Mh7:mStep candM { state := S₃, head := h, left := L, right := R } = some c'hs1:mStep candM { state := q₁, head := h, left := L, right := R } =
some { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R }hs6:mStep candM { state := S₂, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₃, head := h, left := L, right := R }hmid:mNSteps candM 5 { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₃, head := h, left := L, right := R }⊢ mNSteps candM (1 + (5 + 1)) { state := q₁, head := h, left := L, right := R } = some c' mNSteps_add, M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P₁:Fin 380P₂:Fin 380P₃:Fin 380S₁:Fin 380S₂:Fin 380S₃:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P₁)h2:zf380Trans (↑P₁) L.mBit = some (L.mBit, Dir.left, P₂)h3:zf380Trans (↑P₂) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, P₃)h4:zf380Trans (↑P₃) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, S₁)h5:zf380Trans (↑S₁) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, S₂)h6:zf380Trans (↑S₂) L.mBit = some (L.mBit, Dir.right, S₃)c':MCfg 380 Mh7:mStep candM { state := S₃, head := h, left := L, right := R } = some c'hs1:mStep candM { state := q₁, head := h, left := L, right := R } =
some { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R }hs6:mStep candM { state := S₂, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₃, head := h, left := L, right := R }hmid:mNSteps candM 5 { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₃, head := h, left := L, right := R }⊢ (mNSteps candM 1 { state := q₁, head := h, left := L, right := R }).bind (mNSteps candM (5 + 1)) = some c'
show mNSteps candM 1 ⟨q₁, h, L, R⟩ = some ⟨P₁, mBit L, mHalf L, mCons h R⟩ by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P₁:Fin 380P₂:Fin 380P₃:Fin 380S₁:Fin 380S₂:Fin 380S₃:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P₁)h2:zf380Trans (↑P₁) L.mBit = some (L.mBit, Dir.left, P₂)h3:zf380Trans (↑P₂) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, P₃)h4:zf380Trans (↑P₃) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, S₁)h5:zf380Trans (↑S₁) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, S₂)h6:zf380Trans (↑S₂) L.mBit = some (L.mBit, Dir.right, S₃)c':MCfg 380 Mh7:mStep candM { state := S₃, head := h, left := L, right := R } = some c'⊢ mNSteps candM 7 { state := q₁, head := h, left := L, right := R } = some c'
simpa [mNSteps] using hs1 All goals completed! 🐙] M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P₁:Fin 380P₂:Fin 380P₃:Fin 380S₁:Fin 380S₂:Fin 380S₃:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P₁)h2:zf380Trans (↑P₁) L.mBit = some (L.mBit, Dir.left, P₂)h3:zf380Trans (↑P₂) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, P₃)h4:zf380Trans (↑P₃) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, S₁)h5:zf380Trans (↑S₁) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, S₂)h6:zf380Trans (↑S₂) L.mBit = some (L.mBit, Dir.right, S₃)c':MCfg 380 Mh7:mStep candM { state := S₃, head := h, left := L, right := R } = some c'hs1:mStep candM { state := q₁, head := h, left := L, right := R } =
some { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R }hs6:mStep candM { state := S₂, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₃, head := h, left := L, right := R }hmid:mNSteps candM 5 { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₃, head := h, left := L, right := R }⊢ (some { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R }).bind (mNSteps candM (5 + 1)) = some c'
dsimp only [Option.bind] M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P₁:Fin 380P₂:Fin 380P₃:Fin 380S₁:Fin 380S₂:Fin 380S₃:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P₁)h2:zf380Trans (↑P₁) L.mBit = some (L.mBit, Dir.left, P₂)h3:zf380Trans (↑P₂) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, P₃)h4:zf380Trans (↑P₃) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, S₁)h5:zf380Trans (↑S₁) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, S₂)h6:zf380Trans (↑S₂) L.mBit = some (L.mBit, Dir.right, S₃)c':MCfg 380 Mh7:mStep candM { state := S₃, head := h, left := L, right := R } = some c'hs1:mStep candM { state := q₁, head := h, left := L, right := R } =
some { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R }hs6:mStep candM { state := S₂, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₃, head := h, left := L, right := R }hmid:mNSteps candM 5 { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₃, head := h, left := L, right := R }⊢ mNSteps candM (5 + 1) { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R } = some c'
rw [mNSteps_add, M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P₁:Fin 380P₂:Fin 380P₃:Fin 380S₁:Fin 380S₂:Fin 380S₃:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P₁)h2:zf380Trans (↑P₁) L.mBit = some (L.mBit, Dir.left, P₂)h3:zf380Trans (↑P₂) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, P₃)h4:zf380Trans (↑P₃) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, S₁)h5:zf380Trans (↑S₁) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, S₂)h6:zf380Trans (↑S₂) L.mBit = some (L.mBit, Dir.right, S₃)c':MCfg 380 Mh7:mStep candM { state := S₃, head := h, left := L, right := R } = some c'hs1:mStep candM { state := q₁, head := h, left := L, right := R } =
some { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R }hs6:mStep candM { state := S₂, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₃, head := h, left := L, right := R }hmid:mNSteps candM 5 { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₃, head := h, left := L, right := R }⊢ (mNSteps candM 5 { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R }).bind (mNSteps candM 1) = some c' hmid M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P₁:Fin 380P₂:Fin 380P₃:Fin 380S₁:Fin 380S₂:Fin 380S₃:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P₁)h2:zf380Trans (↑P₁) L.mBit = some (L.mBit, Dir.left, P₂)h3:zf380Trans (↑P₂) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, P₃)h4:zf380Trans (↑P₃) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, S₁)h5:zf380Trans (↑S₁) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, S₂)h6:zf380Trans (↑S₂) L.mBit = some (L.mBit, Dir.right, S₃)c':MCfg 380 Mh7:mStep candM { state := S₃, head := h, left := L, right := R } = some c'hs1:mStep candM { state := q₁, head := h, left := L, right := R } =
some { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R }hs6:mStep candM { state := S₂, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₃, head := h, left := L, right := R }hmid:mNSteps candM 5 { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₃, head := h, left := L, right := R }⊢ (some { state := S₃, head := h, left := L, right := R }).bind (mNSteps candM 1) = some c'] M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P₁:Fin 380P₂:Fin 380P₃:Fin 380S₁:Fin 380S₂:Fin 380S₃:Fin 380h:Fin 2L:PAM MR:PAM Mh1:zf380Trans (↑q₁) h = some (h, Dir.left, P₁)h2:zf380Trans (↑P₁) L.mBit = some (L.mBit, Dir.left, P₂)h3:zf380Trans (↑P₂) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, P₃)h4:zf380Trans (↑P₃) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, S₁)h5:zf380Trans (↑S₁) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, S₂)h6:zf380Trans (↑S₂) L.mBit = some (L.mBit, Dir.right, S₃)c':MCfg 380 Mh7:mStep candM { state := S₃, head := h, left := L, right := R } = some c'hs1:mStep candM { state := q₁, head := h, left := L, right := R } =
some { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R }hs6:mStep candM { state := S₂, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₃, head := h, left := L, right := R }hmid:mNSteps candM 5 { state := P₁, head := L.mBit, left := L.mHalf, right := mCons h R } =
some { state := S₃, head := h, left := L, right := R }⊢ (some { state := S₃, head := h, left := L, right := R }).bind (mNSteps candM 1) = some c'
simpa [mNSteps] using h7 All goals completed! 🐙private theorem mStep_nine_left_right_left_left_left_right_right_right
{q₁ P₀ q₂ P₁ P₂ P₃ S₁ S₂ S₃ : Fin 380} {h : Fin 2} {L R : PAM M}
(h0a : zf380Trans q₁.val h = some (h, Dir.left, P₀))
(h0b : zf380Trans P₀.val (mBit L) = some (mBit L, Dir.right, q₂))
(h1 : zf380Trans q₂.val h = some (h, Dir.left, P₁))
(h2 : zf380Trans P₁.val (mBit L) = some (mBit L, Dir.left, P₂))
(h3 : zf380Trans P₂.val (mBit (mHalf L)) = some (mBit (mHalf L), Dir.left, P₃))
(h4 : zf380Trans P₃.val (mBit (mHalf (mHalf L))) =
some (mBit (mHalf (mHalf L)), Dir.right, S₁))
(h5 : zf380Trans S₁.val (mBit (mHalf L)) = some (mBit (mHalf L), Dir.right, S₂))
(h6 : zf380Trans S₂.val (mBit L) = some (mBit L, Dir.right, S₃))
{c' : MCfg 380 M} (h7 : mStep candM ⟨S₃, h, L, R⟩ = some c') :
mNSteps candM 9 ⟨q₁, h, L, R⟩ = some c' := by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P₀:Fin 380q₂:Fin 380P₁:Fin 380P₂:Fin 380P₃:Fin 380S₁:Fin 380S₂:Fin 380S₃:Fin 380h:Fin 2L:PAM MR:PAM Mh0a:zf380Trans (↑q₁) h = some (h, Dir.left, P₀)h0b:zf380Trans (↑P₀) L.mBit = some (L.mBit, Dir.right, q₂)h1:zf380Trans (↑q₂) h = some (h, Dir.left, P₁)h2:zf380Trans (↑P₁) L.mBit = some (L.mBit, Dir.left, P₂)h3:zf380Trans (↑P₂) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, P₃)h4:zf380Trans (↑P₃) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, S₁)h5:zf380Trans (↑S₁) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, S₂)h6:zf380Trans (↑S₂) L.mBit = some (L.mBit, Dir.right, S₃)c':MCfg 380 Mh7:mStep candM { state := S₃, head := h, left := L, right := R } = some c'⊢ mNSteps candM 9 { state := q₁, head := h, left := L, right := R } = some c'
rw [show (9 : ℕ) = 2 + 7 from rfl, M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P₀:Fin 380q₂:Fin 380P₁:Fin 380P₂:Fin 380P₃:Fin 380S₁:Fin 380S₂:Fin 380S₃:Fin 380h:Fin 2L:PAM MR:PAM Mh0a:zf380Trans (↑q₁) h = some (h, Dir.left, P₀)h0b:zf380Trans (↑P₀) L.mBit = some (L.mBit, Dir.right, q₂)h1:zf380Trans (↑q₂) h = some (h, Dir.left, P₁)h2:zf380Trans (↑P₁) L.mBit = some (L.mBit, Dir.left, P₂)h3:zf380Trans (↑P₂) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, P₃)h4:zf380Trans (↑P₃) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, S₁)h5:zf380Trans (↑S₁) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, S₂)h6:zf380Trans (↑S₂) L.mBit = some (L.mBit, Dir.right, S₃)c':MCfg 380 Mh7:mStep candM { state := S₃, head := h, left := L, right := R } = some c'⊢ mNSteps candM (2 + 7) { state := q₁, head := h, left := L, right := R } = some c' mNSteps_add, M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P₀:Fin 380q₂:Fin 380P₁:Fin 380P₂:Fin 380P₃:Fin 380S₁:Fin 380S₂:Fin 380S₃:Fin 380h:Fin 2L:PAM MR:PAM Mh0a:zf380Trans (↑q₁) h = some (h, Dir.left, P₀)h0b:zf380Trans (↑P₀) L.mBit = some (L.mBit, Dir.right, q₂)h1:zf380Trans (↑q₂) h = some (h, Dir.left, P₁)h2:zf380Trans (↑P₁) L.mBit = some (L.mBit, Dir.left, P₂)h3:zf380Trans (↑P₂) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, P₃)h4:zf380Trans (↑P₃) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, S₁)h5:zf380Trans (↑S₁) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, S₂)h6:zf380Trans (↑S₂) L.mBit = some (L.mBit, Dir.right, S₃)c':MCfg 380 Mh7:mStep candM { state := S₃, head := h, left := L, right := R } = some c'⊢ (mNSteps candM 2 { state := q₁, head := h, left := L, right := R }).bind (mNSteps candM 7) = some c' mStep_lr_pair h L R h0a h0b M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P₀:Fin 380q₂:Fin 380P₁:Fin 380P₂:Fin 380P₃:Fin 380S₁:Fin 380S₂:Fin 380S₃:Fin 380h:Fin 2L:PAM MR:PAM Mh0a:zf380Trans (↑q₁) h = some (h, Dir.left, P₀)h0b:zf380Trans (↑P₀) L.mBit = some (L.mBit, Dir.right, q₂)h1:zf380Trans (↑q₂) h = some (h, Dir.left, P₁)h2:zf380Trans (↑P₁) L.mBit = some (L.mBit, Dir.left, P₂)h3:zf380Trans (↑P₂) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, P₃)h4:zf380Trans (↑P₃) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, S₁)h5:zf380Trans (↑S₁) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, S₂)h6:zf380Trans (↑S₂) L.mBit = some (L.mBit, Dir.right, S₃)c':MCfg 380 Mh7:mStep candM { state := S₃, head := h, left := L, right := R } = some c'⊢ (some { state := q₂, head := h, left := L, right := R }).bind (mNSteps candM 7) = some c'] M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq₁:Fin 380P₀:Fin 380q₂:Fin 380P₁:Fin 380P₂:Fin 380P₃:Fin 380S₁:Fin 380S₂:Fin 380S₃:Fin 380h:Fin 2L:PAM MR:PAM Mh0a:zf380Trans (↑q₁) h = some (h, Dir.left, P₀)h0b:zf380Trans (↑P₀) L.mBit = some (L.mBit, Dir.right, q₂)h1:zf380Trans (↑q₂) h = some (h, Dir.left, P₁)h2:zf380Trans (↑P₁) L.mBit = some (L.mBit, Dir.left, P₂)h3:zf380Trans (↑P₂) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, P₃)h4:zf380Trans (↑P₃) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, S₁)h5:zf380Trans (↑S₁) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, S₂)h6:zf380Trans (↑S₂) L.mBit = some (L.mBit, Dir.right, S₃)c':MCfg 380 Mh7:mStep candM { state := S₃, head := h, left := L, right := R } = some c'⊢ (some { state := q₂, head := h, left := L, right := R }).bind (mNSteps candM 7) = some c'
exact mStep_seven_left_left_left_right_right_right h1 h2 h3 h4 h5 h6 h7 All goals completed! 🐙private theorem mStep_preserves_valid (q : Fin 393) (h : Fin 2) (L R : PAM M)
(hv : validState q.val (mBit (mHalf (mHalf L))) (mBit (mHalf L)) (mBit L) h (mBit R) = true) :
match mStep refM ⟨q, h, L, R⟩ with
| none => True
| some c =>
validState c.state.val (mBit (mHalf (mHalf c.left))) (mBit (mHalf c.left)) (mBit c.left)
c.head (mBit c.right) = true := by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393h:Fin 2L:PAM MR:PAM Mhv:validState (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit = true⊢ match mStep refM { state := q, head := h, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = true
have hnext := validState_next q (mBit (mHalf (mHalf L))) (mBit (mHalf L)) (mBit L) h (mBit R) M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393h:Fin 2L:PAM MR:PAM Mhv:validState (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit = truehnext:∀ (x : Fin 2),
validState (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit = true →
checkNext (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit x = true⊢ match mStep refM { state := q, head := h, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = true
dsimp only [mStep] M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393h:Fin 2L:PAM MR:PAM Mhv:validState (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit = truehnext:∀ (x : Fin 2),
validState (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit = true →
checkNext (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit x = true⊢ match
match refM.transition q h with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = true
rw [ConjectureMachines.Zf393.zf393Trans_eq q h M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393h:Fin 2L:PAM MR:PAM Mhv:validState (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit = truehnext:∀ (x : Fin 2),
validState (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit = true →
checkNext (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit x = true⊢ match
match Zf393.zf393Trans q h with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = true] M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393h:Fin 2L:PAM MR:PAM Mhv:validState (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit = truehnext:∀ (x : Fin 2),
validState (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit = true →
checkNext (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit x = true⊢ match
match Zf393.zf393Trans q h with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = true
rcases e : ConjectureMachines.Zf393.zf393Trans q h with _ | ⟨w, d, q'⟩ none M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393h:Fin 2L:PAM MR:PAM Mhv:validState (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit = truehnext:∀ (x : Fin 2),
validState (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit = true →
checkNext (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit x = truee:Zf393.zf393Trans q h = none⊢ match
match none with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truesome M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393h:Fin 2L:PAM MR:PAM Mhv:validState (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit = truehnext:∀ (x : Fin 2),
validState (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit = true →
checkNext (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit x = truew:Fin 2d:Dirq':Fin 393e:Zf393.zf393Trans q h = some (w, d, q')⊢ match
match some (w, d, q') with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = true
· none M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393h:Fin 2L:PAM MR:PAM Mhv:validState (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit = truehnext:∀ (x : Fin 2),
validState (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit = true →
checkNext (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit x = truee:Zf393.zf393Trans q h = none⊢ match
match none with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = true trivial All goals completed! 🐙
· some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393h:Fin 2L:PAM MR:PAM Mhv:validState (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit = truehnext:∀ (x : Fin 2),
validState (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit = true →
checkNext (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit x = truew:Fin 2d:Dirq':Fin 393e:Zf393.zf393Trans q h = some (w, d, q')⊢ match
match some (w, d, q') with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = true cases d some.left M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393h:Fin 2L:PAM MR:PAM Mhv:validState (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit = truehnext:∀ (x : Fin 2),
validState (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit = true →
checkNext (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit x = truew:Fin 2q':Fin 393e:Zf393.zf393Trans q h = some (w, Dir.left, q')⊢ match
match some (w, Dir.left, q') with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truesome.right M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393h:Fin 2L:PAM MR:PAM Mhv:validState (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit = truehnext:∀ (x : Fin 2),
validState (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit = true →
checkNext (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit x = truew:Fin 2q':Fin 393e:Zf393.zf393Trans q h = some (w, Dir.right, q')⊢ match
match some (w, Dir.right, q') with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = true
· some.left M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393h:Fin 2L:PAM MR:PAM Mhv:validState (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit = truehnext:∀ (x : Fin 2),
validState (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit = true →
checkNext (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit x = truew:Fin 2q':Fin 393e:Zf393.zf393Trans q h = some (w, Dir.left, q')⊢ match
match some (w, Dir.left, q') with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = true simpa [checkNext, Nat.mod_eq_of_lt q.isLt, e] using
hnext (mBit (mHalf (mHalf (mHalf L)))) hv All goals completed! 🐙
· some.right M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393h:Fin 2L:PAM MR:PAM Mhv:validState (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit = truehnext:∀ (x : Fin 2),
validState (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit = true →
checkNext (↑q) L.mHalf.mHalf.mBit L.mHalf.mBit L.mBit h R.mBit x = truew:Fin 2q':Fin 393e:Zf393.zf393Trans q h = some (w, Dir.right, q')⊢ match
match some (w, Dir.right, q') with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = true simpa [checkNext, Nat.mod_eq_of_lt q.isLt, e] using
hnext (mBit (mHalf R)) hv All goals completed! 🐙private theorem zf393Trans_eq_none_of_mStep_none {q : Fin 393} {hd : Fin 2} {L R : PAM M}
(e : mStep refM ⟨q, hd, L, R⟩ = none) :
ConjectureMachines.Zf393.zf393Trans q hd = none := by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Me:mStep refM { state := q, head := hd, left := L, right := R } = none⊢ Zf393.zf393Trans q hd = none
dsimp only [mStep] at e M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Me:(match refM.transition q hd with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R }) =
none⊢ Zf393.zf393Trans q hd = none
rw [ConjectureMachines.Zf393.zf393Trans_eq M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Me:(match Zf393.zf393Trans q hd with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R }) =
none⊢ Zf393.zf393Trans q hd = none] at e M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Me:(match Zf393.zf393Trans q hd with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R }) =
none⊢ Zf393.zf393Trans q hd = none
rcases htr : ConjectureMachines.Zf393.zf393Trans q hd with _ | ⟨w, d, q'⟩ none M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Me:(match Zf393.zf393Trans q hd with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R }) =
nonehtr:Zf393.zf393Trans q hd = none⊢ none = nonesome M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Me:(match Zf393.zf393Trans q hd with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R }) =
nonew:Fin 2d:Dirq':Fin 393htr:Zf393.zf393Trans q hd = some (w, d, q')⊢ some (w, d, q') = none
· none M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Me:(match Zf393.zf393Trans q hd with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R }) =
nonehtr:Zf393.zf393Trans q hd = none⊢ none = none rfl All goals completed! 🐙
· some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Me:(match Zf393.zf393Trans q hd with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R }) =
nonew:Fin 2d:Dirq':Fin 393htr:Zf393.zf393Trans q hd = some (w, d, q')⊢ some (w, d, q') = none cases d some.left M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Me:(match Zf393.zf393Trans q hd with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R }) =
nonew:Fin 2q':Fin 393htr:Zf393.zf393Trans q hd = some (w, Dir.left, q')⊢ some (w, Dir.left, q') = nonesome.right M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Me:(match Zf393.zf393Trans q hd with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R }) =
nonew:Fin 2q':Fin 393htr:Zf393.zf393Trans q hd = some (w, Dir.right, q')⊢ some (w, Dir.right, q') = none <;> some.left M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Me:(match Zf393.zf393Trans q hd with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R }) =
nonew:Fin 2q':Fin 393htr:Zf393.zf393Trans q hd = some (w, Dir.left, q')⊢ some (w, Dir.left, q') = nonesome.right M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Me:(match Zf393.zf393Trans q hd with
| none => none
| some (w, Dir.right, q') => some { state := q', head := R.mBit, left := mCons w L, right := R.mHalf }
| some (w, Dir.left, q') => some { state := q', head := L.mBit, left := L.mHalf, right := mCons w R }) =
nonew:Fin 2q':Fin 393htr:Zf393.zf393Trans q hd = some (w, Dir.right, q')⊢ some (w, Dir.right, q') = none simp [htr] at e All goals completed! 🐙
Single-step lockstep/macro-step simulation of refM (zf_393) by candM (zf_380) in
PAM M.
theorem mRespects {c₁ : MCfg 393 M} {c₂ : MCfg 380 M} (hrel : MRel c₁ c₂) :
match mStep refM c₁ with
| none => mStep candM c₂ = none
| some c₁' =>
∃ (k : Fin 9) (c₂' : MCfg 380 M),
MRel c₁' c₂' ∧ mNSteps candM (k.val + 1) c₂ = some c₂' := by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mc₁:MCfg 393 Mc₂:MCfg 380 Mhrel:MRel c₁ c₂⊢ match mStep refM c₁ with
| none => mStep candM c₂ = none
| some c₁' => ∃ k c₂', MRel c₁' c₂' ∧ mNSteps candM (↑k + 1) c₂ = some c₂'
obtain ⟨hv, h⟩ := hrel M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mc₁:MCfg 393 Mc₂:MCfg 380 Mhv:validState (↑c₁.state) c₁.left.mHalf.mHalf.mBit c₁.left.mHalf.mBit c₁.left.mBit c₁.head c₁.right.mBit = trueh:c₂ = { state := mapState (↑c₁.state) c₁.left.mBit c₁.head, head := c₁.head, left := c₁.left, right := c₁.right }⊢ match mStep refM c₁ with
| none => mStep candM c₂ = none
| some c₁' => ∃ k c₂', MRel c₁' c₂' ∧ mNSteps candM (↑k + 1) c₂ = some c₂'
subst h M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mc₁:MCfg 393 Mhv:validState (↑c₁.state) c₁.left.mHalf.mHalf.mBit c₁.left.mHalf.mBit c₁.left.mBit c₁.head c₁.right.mBit = true⊢ match mStep refM c₁ with
| none =>
mStep candM
{ state := mapState (↑c₁.state) c₁.left.mBit c₁.head, head := c₁.head, left := c₁.left, right := c₁.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{ state := mapState (↑c₁.state) c₁.left.mBit c₁.head, head := c₁.head, left := c₁.left, right := c₁.right } =
some c₂'
rcases c₁ with ⟨q, hd, L, R⟩ M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
true⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
have hpres := mStep_preserves_valid q hd L R hv M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = true⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
have hv1 := validState1_of_validState q.val
(mBit (mHalf (mHalf L))) (mBit (mHalf L)) (mBit L) hd (mBit R) hv M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = true⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
cases h3 : isThreeStep q.val (mBit L) hd false M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = false⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = true⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
· false M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = false⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂' cases h5a : isFiveStepLRLR q.val hd false.false M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = false⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'false.true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = true⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
· false.false M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = false⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂' cases h5b : isFiveStepLLRR q.val (mBit L) hd false.false.false M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = false⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'false.false.true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = true⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
· false.false.false M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = false⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂' cases h7 : isSevenStepLLLRRR q.val hd false.false.false.false M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = false⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'false.false.false.true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = true⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
· false.false.false.false M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = false⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂' cases h9 : isNineStepLRLLLRRR q.val hd false.false.false.false.false M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = falseh9:isNineStepLRLLLRRR (↑q) hd = false⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'false.false.false.false.true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = falseh9:isNineStepLRLLLRRR (↑q) hd = true⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
· false.false.false.false.false M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = falseh9:isNineStepLRLLLRRR (↑q) hd = false⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂' have hm : isMultiStep q.val (mBit L) hd = false := by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mc₁:MCfg 393 Mc₂:MCfg 380 Mhrel:MRel c₁ c₂⊢ match mStep refM c₁ with
| none => mStep candM c₂ = none
| some c₁' => ∃ k c₂', MRel c₁' c₂' ∧ mNSteps candM (↑k + 1) c₂ = some c₂'
simp [isMultiStep, h3, h5a, h5b, h7, h9] false.false.false.false.false M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = falseh9:isNineStepLRLLLRRR (↑q) hd = falsehm:isMultiStep (↑q) L.mBit hd = false⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
have hstep := mStep_of_transition_eq hd L R
(transition_oneStep q (mBit (mHalf L)) (mBit L) hd (mBit R) hm hv1) false.false.false.false.false M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = falseh9:isNineStepLRLLLRRR (↑q) hd = falsehm:isMultiStep (↑q) L.mBit hd = falsehstep:mStep candM { state := mapState (↑q) L.mBit hd, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(mStep refM { state := q, head := hd, left := L, right := R })⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
rcases e : mStep refM ⟨q, hd, L, R⟩ with _ | c false.false.false.false.false.none M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = falseh9:isNineStepLRLLLRRR (↑q) hd = falsehm:isMultiStep (↑q) L.mBit hd = falsehstep:mStep candM { state := mapState (↑q) L.mBit hd, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(mStep refM { state := q, head := hd, left := L, right := R })e:mStep refM { state := q, head := hd, left := L, right := R } = none⊢ match none with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'false.false.false.false.false.some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = falseh9:isNineStepLRLLLRRR (↑q) hd = falsehm:isMultiStep (↑q) L.mBit hd = falsehstep:mStep candM { state := mapState (↑q) L.mBit hd, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(mStep refM { state := q, head := hd, left := L, right := R })c:MCfg 393 Me:mStep refM { state := q, head := hd, left := L, right := R } = some c⊢ match some c with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
· false.false.false.false.false.none M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = falseh9:isNineStepLRLLLRRR (↑q) hd = falsehm:isMultiStep (↑q) L.mBit hd = falsehstep:mStep candM { state := mapState (↑q) L.mBit hd, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(mStep refM { state := q, head := hd, left := L, right := R })e:mStep refM { state := q, head := hd, left := L, right := R } = none⊢ match none with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂' simpa [hstep] using e All goals completed! 🐙
· false.false.false.false.false.some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = falseh9:isNineStepLRLLLRRR (↑q) hd = falsehm:isMultiStep (↑q) L.mBit hd = falsehstep:mStep candM { state := mapState (↑q) L.mBit hd, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(mStep refM { state := q, head := hd, left := L, right := R })c:MCfg 393 Me:mStep refM { state := q, head := hd, left := L, right := R } = some c⊢ match some c with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂' rw [e false.false.false.false.false.some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = falseh9:isNineStepLRLLLRRR (↑q) hd = falsehm:isMultiStep (↑q) L.mBit hd = falsehstep:mStep candM { state := mapState (↑q) L.mBit hd, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(mStep refM { state := q, head := hd, left := L, right := R })c:MCfg 393 Mhpres:match some c with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truee:mStep refM { state := q, head := hd, left := L, right := R } = some c⊢ match some c with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'] at hpres false.false.false.false.false.some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = falseh9:isNineStepLRLLLRRR (↑q) hd = falsehm:isMultiStep (↑q) L.mBit hd = falsehstep:mStep candM { state := mapState (↑q) L.mBit hd, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(mStep refM { state := q, head := hd, left := L, right := R })c:MCfg 393 Mhpres:match some c with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truee:mStep refM { state := q, head := hd, left := L, right := R } = some c⊢ match some c with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
exact ⟨⟨0, by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = falseh9:isNineStepLRLLLRRR (↑q) hd = falsehm:isMultiStep (↑q) L.mBit hd = falsehstep:mStep candM { state := mapState (↑q) L.mBit hd, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(mStep refM { state := q, head := hd, left := L, right := R })c:MCfg 393 Mhpres:match some c with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truee:mStep refM { state := q, head := hd, left := L, right := R } = some c⊢ 0 < 9 decide All goals completed! 🐙⟩, ⟨mapState c.state.val (mBit c.left) c.head,
c.head, c.left, c.right⟩, ⟨hpres, rfl⟩,
by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = falseh9:isNineStepLRLLLRRR (↑q) hd = falsehm:isMultiStep (↑q) L.mBit hd = falsehstep:mStep candM { state := mapState (↑q) L.mBit hd, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(mStep refM { state := q, head := hd, left := L, right := R })c:MCfg 393 Mhpres:match some c with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truee:mStep refM { state := q, head := hd, left := L, right := R } = some c⊢ mNSteps candM (↑⟨0, ⋯⟩ + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right } simp [mNSteps, hstep, e] All goals completed! 🐙⟩
· false.false.false.false.true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = falseh9:isNineStepLRLLLRRR (↑q) hd = true⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂' have h0a := transition_nineStep_0a q (mBit (mHalf (mHalf L))) (mBit (mHalf L))
(mBit L) hd (mBit R) h9 hv false.false.false.false.true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = falseh9:isNineStepLRLLLRRR (↑q) hd = trueh0a:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, renum 197)⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
have h0b := transition_nineStep_0b q (mBit (mHalf (mHalf L))) (mBit (mHalf L))
(mBit L) hd (mBit R) h9 hv false.false.false.false.true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = falseh9:isNineStepLRLLLRRR (↑q) hd = trueh0a:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, renum 197)h0b:zf380Trans (↑(renum 197)) L.mBit = some (L.mBit, Dir.right, renum 354)⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
have h1 := transition_nineStep_1 q (mBit (mHalf (mHalf L))) (mBit (mHalf L))
(mBit L) hd (mBit R) h9 hv false.false.false.false.true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = falseh9:isNineStepLRLLLRRR (↑q) hd = trueh0a:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, renum 197)h0b:zf380Trans (↑(renum 197)) L.mBit = some (L.mBit, Dir.right, renum 354)h1:zf380Trans (↑(renum 354)) hd = some (hd, Dir.left, renum 362)⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
have h2 := transition_nineStep_2 q (mBit (mHalf (mHalf L))) (mBit (mHalf L))
(mBit L) hd (mBit R) h9 hv false.false.false.false.true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = falseh9:isNineStepLRLLLRRR (↑q) hd = trueh0a:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, renum 197)h0b:zf380Trans (↑(renum 197)) L.mBit = some (L.mBit, Dir.right, renum 354)h1:zf380Trans (↑(renum 354)) hd = some (hd, Dir.left, renum 362)h2:zf380Trans (↑(renum 362)) L.mBit = some (L.mBit, Dir.left, renum 346)⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
have h3' := transition_nineStep_3 q (mBit (mHalf (mHalf L))) (mBit (mHalf L))
(mBit L) hd (mBit R) h9 hv false.false.false.false.true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = falseh9:isNineStepLRLLLRRR (↑q) hd = trueh0a:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, renum 197)h0b:zf380Trans (↑(renum 197)) L.mBit = some (L.mBit, Dir.right, renum 354)h1:zf380Trans (↑(renum 354)) hd = some (hd, Dir.left, renum 362)h2:zf380Trans (↑(renum 362)) L.mBit = some (L.mBit, Dir.left, renum 346)h3':zf380Trans (↑(renum 346)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, renum 100)⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
have h4 := transition_nineStep_4 q (mBit (mHalf (mHalf L))) (mBit (mHalf L))
(mBit L) hd (mBit R) h9 hv false.false.false.false.true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = falseh9:isNineStepLRLLLRRR (↑q) hd = trueh0a:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, renum 197)h0b:zf380Trans (↑(renum 197)) L.mBit = some (L.mBit, Dir.right, renum 354)h1:zf380Trans (↑(renum 354)) hd = some (hd, Dir.left, renum 362)h2:zf380Trans (↑(renum 362)) L.mBit = some (L.mBit, Dir.left, renum 346)h3':zf380Trans (↑(renum 346)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, renum 100)h4:zf380Trans (↑(renum 100)) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, renum 101)⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
have h5 := transition_nineStep_5 q (mBit (mHalf (mHalf L))) (mBit (mHalf L))
(mBit L) hd (mBit R) h9 hv false.false.false.false.true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = falseh9:isNineStepLRLLLRRR (↑q) hd = trueh0a:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, renum 197)h0b:zf380Trans (↑(renum 197)) L.mBit = some (L.mBit, Dir.right, renum 354)h1:zf380Trans (↑(renum 354)) hd = some (hd, Dir.left, renum 362)h2:zf380Trans (↑(renum 362)) L.mBit = some (L.mBit, Dir.left, renum 346)h3':zf380Trans (↑(renum 346)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, renum 100)h4:zf380Trans (↑(renum 100)) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, renum 101)h5:zf380Trans (↑(renum 101)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, renum 102)⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
have h6 := transition_nineStep_6 q (mBit (mHalf (mHalf L))) (mBit (mHalf L))
(mBit L) hd (mBit R) h9 hv false.false.false.false.true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = falseh9:isNineStepLRLLLRRR (↑q) hd = trueh0a:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, renum 197)h0b:zf380Trans (↑(renum 197)) L.mBit = some (L.mBit, Dir.right, renum 354)h1:zf380Trans (↑(renum 354)) hd = some (hd, Dir.left, renum 362)h2:zf380Trans (↑(renum 362)) L.mBit = some (L.mBit, Dir.left, renum 346)h3':zf380Trans (↑(renum 346)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, renum 100)h4:zf380Trans (↑(renum 100)) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, renum 101)h5:zf380Trans (↑(renum 101)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, renum 102)h6:zf380Trans (↑(renum 102)) L.mBit = some (L.mBit, Dir.right, renum 352)⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
have hstep9 := mStep_of_transition_eq hd L R
(transition_nineStep_7 q (mBit (mHalf (mHalf L))) (mBit (mHalf L))
(mBit L) hd (mBit R) h9 hv) false.false.false.false.true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = falseh9:isNineStepLRLLLRRR (↑q) hd = trueh0a:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, renum 197)h0b:zf380Trans (↑(renum 197)) L.mBit = some (L.mBit, Dir.right, renum 354)h1:zf380Trans (↑(renum 354)) hd = some (hd, Dir.left, renum 362)h2:zf380Trans (↑(renum 362)) L.mBit = some (L.mBit, Dir.left, renum 346)h3':zf380Trans (↑(renum 346)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, renum 100)h4:zf380Trans (↑(renum 100)) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, renum 101)h5:zf380Trans (↑(renum 101)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, renum 102)h6:zf380Trans (↑(renum 102)) L.mBit = some (L.mBit, Dir.right, renum 352)hstep9:mStep candM { state := renum 352, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(mStep refM { state := q, head := hd, left := L, right := R })⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
rcases e : mStep refM ⟨q, hd, L, R⟩ with _ | c false.false.false.false.true.none M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = falseh9:isNineStepLRLLLRRR (↑q) hd = trueh0a:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, renum 197)h0b:zf380Trans (↑(renum 197)) L.mBit = some (L.mBit, Dir.right, renum 354)h1:zf380Trans (↑(renum 354)) hd = some (hd, Dir.left, renum 362)h2:zf380Trans (↑(renum 362)) L.mBit = some (L.mBit, Dir.left, renum 346)h3':zf380Trans (↑(renum 346)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, renum 100)h4:zf380Trans (↑(renum 100)) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, renum 101)h5:zf380Trans (↑(renum 101)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, renum 102)h6:zf380Trans (↑(renum 102)) L.mBit = some (L.mBit, Dir.right, renum 352)hstep9:mStep candM { state := renum 352, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(mStep refM { state := q, head := hd, left := L, right := R })e:mStep refM { state := q, head := hd, left := L, right := R } = none⊢ match none with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'false.false.false.false.true.some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = falseh9:isNineStepLRLLLRRR (↑q) hd = trueh0a:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, renum 197)h0b:zf380Trans (↑(renum 197)) L.mBit = some (L.mBit, Dir.right, renum 354)h1:zf380Trans (↑(renum 354)) hd = some (hd, Dir.left, renum 362)h2:zf380Trans (↑(renum 362)) L.mBit = some (L.mBit, Dir.left, renum 346)h3':zf380Trans (↑(renum 346)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, renum 100)h4:zf380Trans (↑(renum 100)) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, renum 101)h5:zf380Trans (↑(renum 101)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, renum 102)h6:zf380Trans (↑(renum 102)) L.mBit = some (L.mBit, Dir.right, renum 352)hstep9:mStep candM { state := renum 352, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(mStep refM { state := q, head := hd, left := L, right := R })c:MCfg 393 Me:mStep refM { state := q, head := hd, left := L, right := R } = some c⊢ match some c with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
· false.false.false.false.true.none M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = falseh9:isNineStepLRLLLRRR (↑q) hd = trueh0a:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, renum 197)h0b:zf380Trans (↑(renum 197)) L.mBit = some (L.mBit, Dir.right, renum 354)h1:zf380Trans (↑(renum 354)) hd = some (hd, Dir.left, renum 362)h2:zf380Trans (↑(renum 362)) L.mBit = some (L.mBit, Dir.left, renum 346)h3':zf380Trans (↑(renum 346)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, renum 100)h4:zf380Trans (↑(renum 100)) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, renum 101)h5:zf380Trans (↑(renum 101)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, renum 102)h6:zf380Trans (↑(renum 102)) L.mBit = some (L.mBit, Dir.right, renum 352)hstep9:mStep candM { state := renum 352, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(mStep refM { state := q, head := hd, left := L, right := R })e:mStep refM { state := q, head := hd, left := L, right := R } = none⊢ match none with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂' exact absurd (zf393Trans_eq_none_of_mStep_none e)
(nineStepLRLLLRRR_not_none q hd h9) All goals completed! 🐙
· false.false.false.false.true.some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = falseh9:isNineStepLRLLLRRR (↑q) hd = trueh0a:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, renum 197)h0b:zf380Trans (↑(renum 197)) L.mBit = some (L.mBit, Dir.right, renum 354)h1:zf380Trans (↑(renum 354)) hd = some (hd, Dir.left, renum 362)h2:zf380Trans (↑(renum 362)) L.mBit = some (L.mBit, Dir.left, renum 346)h3':zf380Trans (↑(renum 346)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, renum 100)h4:zf380Trans (↑(renum 100)) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, renum 101)h5:zf380Trans (↑(renum 101)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, renum 102)h6:zf380Trans (↑(renum 102)) L.mBit = some (L.mBit, Dir.right, renum 352)hstep9:mStep candM { state := renum 352, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(mStep refM { state := q, head := hd, left := L, right := R })c:MCfg 393 Me:mStep refM { state := q, head := hd, left := L, right := R } = some c⊢ match some c with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂' rw [e false.false.false.false.true.some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = falseh9:isNineStepLRLLLRRR (↑q) hd = trueh0a:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, renum 197)h0b:zf380Trans (↑(renum 197)) L.mBit = some (L.mBit, Dir.right, renum 354)h1:zf380Trans (↑(renum 354)) hd = some (hd, Dir.left, renum 362)h2:zf380Trans (↑(renum 362)) L.mBit = some (L.mBit, Dir.left, renum 346)h3':zf380Trans (↑(renum 346)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, renum 100)h4:zf380Trans (↑(renum 100)) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, renum 101)h5:zf380Trans (↑(renum 101)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, renum 102)h6:zf380Trans (↑(renum 102)) L.mBit = some (L.mBit, Dir.right, renum 352)c:MCfg 393 Mhstep9:mStep candM { state := renum 352, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(some c)hpres:match some c with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truee:mStep refM { state := q, head := hd, left := L, right := R } = some c⊢ match some c with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'] at hpres hstep9 false.false.false.false.true.some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = falseh9:isNineStepLRLLLRRR (↑q) hd = trueh0a:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, renum 197)h0b:zf380Trans (↑(renum 197)) L.mBit = some (L.mBit, Dir.right, renum 354)h1:zf380Trans (↑(renum 354)) hd = some (hd, Dir.left, renum 362)h2:zf380Trans (↑(renum 362)) L.mBit = some (L.mBit, Dir.left, renum 346)h3':zf380Trans (↑(renum 346)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, renum 100)h4:zf380Trans (↑(renum 100)) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, renum 101)h5:zf380Trans (↑(renum 101)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, renum 102)h6:zf380Trans (↑(renum 102)) L.mBit = some (L.mBit, Dir.right, renum 352)c:MCfg 393 Mhstep9:mStep candM { state := renum 352, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(some c)hpres:match some c with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truee:mStep refM { state := q, head := hd, left := L, right := R } = some c⊢ match some c with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
exact ⟨⟨8, by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = falseh9:isNineStepLRLLLRRR (↑q) hd = trueh0a:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, renum 197)h0b:zf380Trans (↑(renum 197)) L.mBit = some (L.mBit, Dir.right, renum 354)h1:zf380Trans (↑(renum 354)) hd = some (hd, Dir.left, renum 362)h2:zf380Trans (↑(renum 362)) L.mBit = some (L.mBit, Dir.left, renum 346)h3':zf380Trans (↑(renum 346)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, renum 100)h4:zf380Trans (↑(renum 100)) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, renum 101)h5:zf380Trans (↑(renum 101)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, renum 102)h6:zf380Trans (↑(renum 102)) L.mBit = some (L.mBit, Dir.right, renum 352)c:MCfg 393 Mhstep9:mStep candM { state := renum 352, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(some c)hpres:match some c with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truee:mStep refM { state := q, head := hd, left := L, right := R } = some c⊢ 8 < 9 decide All goals completed! 🐙⟩, ⟨mapState c.state.val (mBit c.left) c.head,
c.head, c.left, c.right⟩, ⟨hpres, rfl⟩,
mStep_nine_left_right_left_left_left_right_right_right
h0a h0b h1 h2 h3' h4 h5 h6 hstep9⟩
· false.false.false.true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = true⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂' have h1 := transition_sevenStepLLLRRR_1 q (mBit (mHalf (mHalf L))) (mBit (mHalf L))
(mBit L) hd (mBit R) h7 hv false.false.false.true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, lllrrrP1 ↑q)⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
have h2 := transition_sevenStepLLLRRR_2 q (mBit (mHalf (mHalf L))) (mBit (mHalf L))
(mBit L) hd (mBit R) h7 hv false.false.false.true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, lllrrrP1 ↑q)h2:zf380Trans (↑(lllrrrP1 ↑q)) L.mBit = some (L.mBit, Dir.left, lllrrrP2 ↑q)⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
have h3' := transition_sevenStepLLLRRR_3 q (mBit (mHalf (mHalf L))) (mBit (mHalf L))
(mBit L) hd (mBit R) h7 hv false.false.false.true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, lllrrrP1 ↑q)h2:zf380Trans (↑(lllrrrP1 ↑q)) L.mBit = some (L.mBit, Dir.left, lllrrrP2 ↑q)h3':zf380Trans (↑(lllrrrP2 ↑q)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, lllrrrP3 ↑q)⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
have h4 := transition_sevenStepLLLRRR_4 q (mBit (mHalf (mHalf L))) (mBit (mHalf L))
(mBit L) hd (mBit R) h7 hv false.false.false.true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, lllrrrP1 ↑q)h2:zf380Trans (↑(lllrrrP1 ↑q)) L.mBit = some (L.mBit, Dir.left, lllrrrP2 ↑q)h3':zf380Trans (↑(lllrrrP2 ↑q)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, lllrrrP3 ↑q)h4:zf380Trans (↑(lllrrrP3 ↑q)) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, lllrrrS1 ↑q)⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
have h5 := transition_sevenStepLLLRRR_5 q (mBit (mHalf (mHalf L))) (mBit (mHalf L))
(mBit L) hd (mBit R) h7 hv false.false.false.true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, lllrrrP1 ↑q)h2:zf380Trans (↑(lllrrrP1 ↑q)) L.mBit = some (L.mBit, Dir.left, lllrrrP2 ↑q)h3':zf380Trans (↑(lllrrrP2 ↑q)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, lllrrrP3 ↑q)h4:zf380Trans (↑(lllrrrP3 ↑q)) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, lllrrrS1 ↑q)h5:zf380Trans (↑(lllrrrS1 ↑q)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, lllrrrS2 ↑q)⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
have h6 := transition_sevenStepLLLRRR_6 q (mBit (mHalf (mHalf L))) (mBit (mHalf L))
(mBit L) hd (mBit R) h7 hv false.false.false.true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, lllrrrP1 ↑q)h2:zf380Trans (↑(lllrrrP1 ↑q)) L.mBit = some (L.mBit, Dir.left, lllrrrP2 ↑q)h3':zf380Trans (↑(lllrrrP2 ↑q)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, lllrrrP3 ↑q)h4:zf380Trans (↑(lllrrrP3 ↑q)) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, lllrrrS1 ↑q)h5:zf380Trans (↑(lllrrrS1 ↑q)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, lllrrrS2 ↑q)h6:zf380Trans (↑(lllrrrS2 ↑q)) L.mBit = some (L.mBit, Dir.right, lllrrrS3 ↑q)⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
have hstep7 := mStep_of_transition_eq hd L R
(transition_sevenStepLLLRRR_7 q (mBit (mHalf (mHalf L))) (mBit (mHalf L))
(mBit L) hd (mBit R) h7 hv) false.false.false.true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, lllrrrP1 ↑q)h2:zf380Trans (↑(lllrrrP1 ↑q)) L.mBit = some (L.mBit, Dir.left, lllrrrP2 ↑q)h3':zf380Trans (↑(lllrrrP2 ↑q)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, lllrrrP3 ↑q)h4:zf380Trans (↑(lllrrrP3 ↑q)) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, lllrrrS1 ↑q)h5:zf380Trans (↑(lllrrrS1 ↑q)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, lllrrrS2 ↑q)h6:zf380Trans (↑(lllrrrS2 ↑q)) L.mBit = some (L.mBit, Dir.right, lllrrrS3 ↑q)hstep7:mStep candM { state := lllrrrS3 ↑q, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(mStep refM { state := q, head := hd, left := L, right := R })⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
rcases e : mStep refM ⟨q, hd, L, R⟩ with _ | c false.false.false.true.none M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, lllrrrP1 ↑q)h2:zf380Trans (↑(lllrrrP1 ↑q)) L.mBit = some (L.mBit, Dir.left, lllrrrP2 ↑q)h3':zf380Trans (↑(lllrrrP2 ↑q)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, lllrrrP3 ↑q)h4:zf380Trans (↑(lllrrrP3 ↑q)) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, lllrrrS1 ↑q)h5:zf380Trans (↑(lllrrrS1 ↑q)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, lllrrrS2 ↑q)h6:zf380Trans (↑(lllrrrS2 ↑q)) L.mBit = some (L.mBit, Dir.right, lllrrrS3 ↑q)hstep7:mStep candM { state := lllrrrS3 ↑q, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(mStep refM { state := q, head := hd, left := L, right := R })e:mStep refM { state := q, head := hd, left := L, right := R } = none⊢ match none with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'false.false.false.true.some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, lllrrrP1 ↑q)h2:zf380Trans (↑(lllrrrP1 ↑q)) L.mBit = some (L.mBit, Dir.left, lllrrrP2 ↑q)h3':zf380Trans (↑(lllrrrP2 ↑q)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, lllrrrP3 ↑q)h4:zf380Trans (↑(lllrrrP3 ↑q)) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, lllrrrS1 ↑q)h5:zf380Trans (↑(lllrrrS1 ↑q)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, lllrrrS2 ↑q)h6:zf380Trans (↑(lllrrrS2 ↑q)) L.mBit = some (L.mBit, Dir.right, lllrrrS3 ↑q)hstep7:mStep candM { state := lllrrrS3 ↑q, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(mStep refM { state := q, head := hd, left := L, right := R })c:MCfg 393 Me:mStep refM { state := q, head := hd, left := L, right := R } = some c⊢ match some c with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
· false.false.false.true.none M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, lllrrrP1 ↑q)h2:zf380Trans (↑(lllrrrP1 ↑q)) L.mBit = some (L.mBit, Dir.left, lllrrrP2 ↑q)h3':zf380Trans (↑(lllrrrP2 ↑q)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, lllrrrP3 ↑q)h4:zf380Trans (↑(lllrrrP3 ↑q)) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, lllrrrS1 ↑q)h5:zf380Trans (↑(lllrrrS1 ↑q)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, lllrrrS2 ↑q)h6:zf380Trans (↑(lllrrrS2 ↑q)) L.mBit = some (L.mBit, Dir.right, lllrrrS3 ↑q)hstep7:mStep candM { state := lllrrrS3 ↑q, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(mStep refM { state := q, head := hd, left := L, right := R })e:mStep refM { state := q, head := hd, left := L, right := R } = none⊢ match none with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂' exact absurd (zf393Trans_eq_none_of_mStep_none e)
(sevenStepLLLRRR_not_none q hd h7) All goals completed! 🐙
· false.false.false.true.some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, lllrrrP1 ↑q)h2:zf380Trans (↑(lllrrrP1 ↑q)) L.mBit = some (L.mBit, Dir.left, lllrrrP2 ↑q)h3':zf380Trans (↑(lllrrrP2 ↑q)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, lllrrrP3 ↑q)h4:zf380Trans (↑(lllrrrP3 ↑q)) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, lllrrrS1 ↑q)h5:zf380Trans (↑(lllrrrS1 ↑q)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, lllrrrS2 ↑q)h6:zf380Trans (↑(lllrrrS2 ↑q)) L.mBit = some (L.mBit, Dir.right, lllrrrS3 ↑q)hstep7:mStep candM { state := lllrrrS3 ↑q, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(mStep refM { state := q, head := hd, left := L, right := R })c:MCfg 393 Me:mStep refM { state := q, head := hd, left := L, right := R } = some c⊢ match some c with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂' rw [e false.false.false.true.some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, lllrrrP1 ↑q)h2:zf380Trans (↑(lllrrrP1 ↑q)) L.mBit = some (L.mBit, Dir.left, lllrrrP2 ↑q)h3':zf380Trans (↑(lllrrrP2 ↑q)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, lllrrrP3 ↑q)h4:zf380Trans (↑(lllrrrP3 ↑q)) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, lllrrrS1 ↑q)h5:zf380Trans (↑(lllrrrS1 ↑q)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, lllrrrS2 ↑q)h6:zf380Trans (↑(lllrrrS2 ↑q)) L.mBit = some (L.mBit, Dir.right, lllrrrS3 ↑q)c:MCfg 393 Mhstep7:mStep candM { state := lllrrrS3 ↑q, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(some c)hpres:match some c with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truee:mStep refM { state := q, head := hd, left := L, right := R } = some c⊢ match some c with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'] at hpres hstep7 false.false.false.true.some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, lllrrrP1 ↑q)h2:zf380Trans (↑(lllrrrP1 ↑q)) L.mBit = some (L.mBit, Dir.left, lllrrrP2 ↑q)h3':zf380Trans (↑(lllrrrP2 ↑q)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, lllrrrP3 ↑q)h4:zf380Trans (↑(lllrrrP3 ↑q)) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, lllrrrS1 ↑q)h5:zf380Trans (↑(lllrrrS1 ↑q)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, lllrrrS2 ↑q)h6:zf380Trans (↑(lllrrrS2 ↑q)) L.mBit = some (L.mBit, Dir.right, lllrrrS3 ↑q)c:MCfg 393 Mhstep7:mStep candM { state := lllrrrS3 ↑q, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(some c)hpres:match some c with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truee:mStep refM { state := q, head := hd, left := L, right := R } = some c⊢ match some c with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
exact ⟨⟨6, by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = falseh7:isSevenStepLLLRRR (↑q) hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, lllrrrP1 ↑q)h2:zf380Trans (↑(lllrrrP1 ↑q)) L.mBit = some (L.mBit, Dir.left, lllrrrP2 ↑q)h3':zf380Trans (↑(lllrrrP2 ↑q)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.left, lllrrrP3 ↑q)h4:zf380Trans (↑(lllrrrP3 ↑q)) L.mHalf.mHalf.mBit = some (L.mHalf.mHalf.mBit, Dir.right, lllrrrS1 ↑q)h5:zf380Trans (↑(lllrrrS1 ↑q)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, lllrrrS2 ↑q)h6:zf380Trans (↑(lllrrrS2 ↑q)) L.mBit = some (L.mBit, Dir.right, lllrrrS3 ↑q)c:MCfg 393 Mhstep7:mStep candM { state := lllrrrS3 ↑q, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(some c)hpres:match some c with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truee:mStep refM { state := q, head := hd, left := L, right := R } = some c⊢ 6 < 9 decide All goals completed! 🐙⟩, ⟨mapState c.state.val (mBit c.left) c.head,
c.head, c.left, c.right⟩, ⟨hpres, rfl⟩,
mStep_seven_left_left_left_right_right_right h1 h2 h3' h4 h5 h6 hstep7⟩
· false.false.true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = true⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂' have h1 := transition_fiveStepLLRR_1 q (mBit (mHalf L)) (mBit L) hd (mBit R) h5b hv1 false.false.true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, llrrP1 ↑q)⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
have h2 := transition_fiveStepLLRR_2 q (mBit (mHalf L)) (mBit L) hd (mBit R) h5b hv1 false.false.true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, llrrP1 ↑q)h2:zf380Trans (↑(llrrP1 ↑q)) L.mBit = some (L.mBit, Dir.left, llrrP2 ↑q)⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
have h3' := transition_fiveStepLLRR_3 q (mBit (mHalf L)) (mBit L) hd (mBit R) h5b hv1 false.false.true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, llrrP1 ↑q)h2:zf380Trans (↑(llrrP1 ↑q)) L.mBit = some (L.mBit, Dir.left, llrrP2 ↑q)h3':zf380Trans (↑(llrrP2 ↑q)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, llrrS1 ↑q)⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
have h4 := transition_fiveStepLLRR_4 q (mBit (mHalf L)) (mBit L) hd (mBit R) h5b hv1 false.false.true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, llrrP1 ↑q)h2:zf380Trans (↑(llrrP1 ↑q)) L.mBit = some (L.mBit, Dir.left, llrrP2 ↑q)h3':zf380Trans (↑(llrrP2 ↑q)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, llrrS1 ↑q)h4:zf380Trans (↑(llrrS1 ↑q)) L.mBit = some (L.mBit, Dir.right, llrrS2 ↑q)⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
have hstep5 := mStep_of_transition_eq hd L R
(transition_fiveStepLLRR_5 q (mBit (mHalf L)) (mBit L) hd (mBit R) h5b hv1) false.false.true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, llrrP1 ↑q)h2:zf380Trans (↑(llrrP1 ↑q)) L.mBit = some (L.mBit, Dir.left, llrrP2 ↑q)h3':zf380Trans (↑(llrrP2 ↑q)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, llrrS1 ↑q)h4:zf380Trans (↑(llrrS1 ↑q)) L.mBit = some (L.mBit, Dir.right, llrrS2 ↑q)hstep5:mStep candM { state := llrrS2 ↑q, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(mStep refM { state := q, head := hd, left := L, right := R })⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
rcases e : mStep refM ⟨q, hd, L, R⟩ with _ | c false.false.true.none M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, llrrP1 ↑q)h2:zf380Trans (↑(llrrP1 ↑q)) L.mBit = some (L.mBit, Dir.left, llrrP2 ↑q)h3':zf380Trans (↑(llrrP2 ↑q)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, llrrS1 ↑q)h4:zf380Trans (↑(llrrS1 ↑q)) L.mBit = some (L.mBit, Dir.right, llrrS2 ↑q)hstep5:mStep candM { state := llrrS2 ↑q, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(mStep refM { state := q, head := hd, left := L, right := R })e:mStep refM { state := q, head := hd, left := L, right := R } = none⊢ match none with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'false.false.true.some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, llrrP1 ↑q)h2:zf380Trans (↑(llrrP1 ↑q)) L.mBit = some (L.mBit, Dir.left, llrrP2 ↑q)h3':zf380Trans (↑(llrrP2 ↑q)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, llrrS1 ↑q)h4:zf380Trans (↑(llrrS1 ↑q)) L.mBit = some (L.mBit, Dir.right, llrrS2 ↑q)hstep5:mStep candM { state := llrrS2 ↑q, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(mStep refM { state := q, head := hd, left := L, right := R })c:MCfg 393 Me:mStep refM { state := q, head := hd, left := L, right := R } = some c⊢ match some c with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
· false.false.true.none M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, llrrP1 ↑q)h2:zf380Trans (↑(llrrP1 ↑q)) L.mBit = some (L.mBit, Dir.left, llrrP2 ↑q)h3':zf380Trans (↑(llrrP2 ↑q)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, llrrS1 ↑q)h4:zf380Trans (↑(llrrS1 ↑q)) L.mBit = some (L.mBit, Dir.right, llrrS2 ↑q)hstep5:mStep candM { state := llrrS2 ↑q, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(mStep refM { state := q, head := hd, left := L, right := R })e:mStep refM { state := q, head := hd, left := L, right := R } = none⊢ match none with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂' exact absurd (zf393Trans_eq_none_of_mStep_none e)
(fiveStepLLRR_not_none q (mBit L) hd h5b) All goals completed! 🐙
· false.false.true.some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, llrrP1 ↑q)h2:zf380Trans (↑(llrrP1 ↑q)) L.mBit = some (L.mBit, Dir.left, llrrP2 ↑q)h3':zf380Trans (↑(llrrP2 ↑q)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, llrrS1 ↑q)h4:zf380Trans (↑(llrrS1 ↑q)) L.mBit = some (L.mBit, Dir.right, llrrS2 ↑q)hstep5:mStep candM { state := llrrS2 ↑q, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(mStep refM { state := q, head := hd, left := L, right := R })c:MCfg 393 Me:mStep refM { state := q, head := hd, left := L, right := R } = some c⊢ match some c with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂' rw [e false.false.true.some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, llrrP1 ↑q)h2:zf380Trans (↑(llrrP1 ↑q)) L.mBit = some (L.mBit, Dir.left, llrrP2 ↑q)h3':zf380Trans (↑(llrrP2 ↑q)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, llrrS1 ↑q)h4:zf380Trans (↑(llrrS1 ↑q)) L.mBit = some (L.mBit, Dir.right, llrrS2 ↑q)c:MCfg 393 Mhstep5:mStep candM { state := llrrS2 ↑q, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(some c)hpres:match some c with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truee:mStep refM { state := q, head := hd, left := L, right := R } = some c⊢ match some c with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'] at hpres hstep5 false.false.true.some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, llrrP1 ↑q)h2:zf380Trans (↑(llrrP1 ↑q)) L.mBit = some (L.mBit, Dir.left, llrrP2 ↑q)h3':zf380Trans (↑(llrrP2 ↑q)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, llrrS1 ↑q)h4:zf380Trans (↑(llrrS1 ↑q)) L.mBit = some (L.mBit, Dir.right, llrrS2 ↑q)c:MCfg 393 Mhstep5:mStep candM { state := llrrS2 ↑q, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(some c)hpres:match some c with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truee:mStep refM { state := q, head := hd, left := L, right := R } = some c⊢ match some c with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
exact ⟨⟨4, by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = falseh5b:isFiveStepLLRR (↑q) L.mBit hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, llrrP1 ↑q)h2:zf380Trans (↑(llrrP1 ↑q)) L.mBit = some (L.mBit, Dir.left, llrrP2 ↑q)h3':zf380Trans (↑(llrrP2 ↑q)) L.mHalf.mBit = some (L.mHalf.mBit, Dir.right, llrrS1 ↑q)h4:zf380Trans (↑(llrrS1 ↑q)) L.mBit = some (L.mBit, Dir.right, llrrS2 ↑q)c:MCfg 393 Mhstep5:mStep candM { state := llrrS2 ↑q, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(some c)hpres:match some c with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truee:mStep refM { state := q, head := hd, left := L, right := R } = some c⊢ 4 < 9 decide All goals completed! 🐙⟩, ⟨mapState c.state.val (mBit c.left) c.head,
c.head, c.left, c.right⟩, ⟨hpres, rfl⟩,
mStep_five_left_left_right_right h1 h2 h3' h4 hstep5⟩
· false.true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = true⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂' have h1 := transition_fiveStepLRLR_1 q (mBit (mHalf L)) (mBit L) hd (mBit R) h5a hv1 false.true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, lrlrP1 ↑q)⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
have h2 := transition_fiveStepLRLR_2 q (mBit (mHalf L)) (mBit L) hd (mBit R) h5a hv1 false.true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, lrlrP1 ↑q)h2:zf380Trans (↑(lrlrP1 ↑q)) L.mBit = some (L.mBit, Dir.right, lrlrS1 ↑q)⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
have h3' := transition_fiveStepLRLR_3 q (mBit (mHalf L)) (mBit L) hd (mBit R) h5a hv1 false.true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, lrlrP1 ↑q)h2:zf380Trans (↑(lrlrP1 ↑q)) L.mBit = some (L.mBit, Dir.right, lrlrS1 ↑q)h3':zf380Trans (↑(lrlrS1 ↑q)) hd = some (hd, Dir.left, lrlrP2 ↑q)⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
have h4 := transition_fiveStepLRLR_4 q (mBit (mHalf L)) (mBit L) hd (mBit R) h5a hv1 false.true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, lrlrP1 ↑q)h2:zf380Trans (↑(lrlrP1 ↑q)) L.mBit = some (L.mBit, Dir.right, lrlrS1 ↑q)h3':zf380Trans (↑(lrlrS1 ↑q)) hd = some (hd, Dir.left, lrlrP2 ↑q)h4:zf380Trans (↑(lrlrP2 ↑q)) L.mBit = some (L.mBit, Dir.right, lrlrS2 ↑q)⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
have hstep5 := mStep_of_transition_eq hd L R
(transition_fiveStepLRLR_5 q (mBit (mHalf L)) (mBit L) hd (mBit R) h5a hv1) false.true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, lrlrP1 ↑q)h2:zf380Trans (↑(lrlrP1 ↑q)) L.mBit = some (L.mBit, Dir.right, lrlrS1 ↑q)h3':zf380Trans (↑(lrlrS1 ↑q)) hd = some (hd, Dir.left, lrlrP2 ↑q)h4:zf380Trans (↑(lrlrP2 ↑q)) L.mBit = some (L.mBit, Dir.right, lrlrS2 ↑q)hstep5:mStep candM { state := lrlrS2 ↑q, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(mStep refM { state := q, head := hd, left := L, right := R })⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
rcases e : mStep refM ⟨q, hd, L, R⟩ with _ | c false.true.none M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, lrlrP1 ↑q)h2:zf380Trans (↑(lrlrP1 ↑q)) L.mBit = some (L.mBit, Dir.right, lrlrS1 ↑q)h3':zf380Trans (↑(lrlrS1 ↑q)) hd = some (hd, Dir.left, lrlrP2 ↑q)h4:zf380Trans (↑(lrlrP2 ↑q)) L.mBit = some (L.mBit, Dir.right, lrlrS2 ↑q)hstep5:mStep candM { state := lrlrS2 ↑q, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(mStep refM { state := q, head := hd, left := L, right := R })e:mStep refM { state := q, head := hd, left := L, right := R } = none⊢ match none with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'false.true.some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, lrlrP1 ↑q)h2:zf380Trans (↑(lrlrP1 ↑q)) L.mBit = some (L.mBit, Dir.right, lrlrS1 ↑q)h3':zf380Trans (↑(lrlrS1 ↑q)) hd = some (hd, Dir.left, lrlrP2 ↑q)h4:zf380Trans (↑(lrlrP2 ↑q)) L.mBit = some (L.mBit, Dir.right, lrlrS2 ↑q)hstep5:mStep candM { state := lrlrS2 ↑q, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(mStep refM { state := q, head := hd, left := L, right := R })c:MCfg 393 Me:mStep refM { state := q, head := hd, left := L, right := R } = some c⊢ match some c with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
· false.true.none M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, lrlrP1 ↑q)h2:zf380Trans (↑(lrlrP1 ↑q)) L.mBit = some (L.mBit, Dir.right, lrlrS1 ↑q)h3':zf380Trans (↑(lrlrS1 ↑q)) hd = some (hd, Dir.left, lrlrP2 ↑q)h4:zf380Trans (↑(lrlrP2 ↑q)) L.mBit = some (L.mBit, Dir.right, lrlrS2 ↑q)hstep5:mStep candM { state := lrlrS2 ↑q, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(mStep refM { state := q, head := hd, left := L, right := R })e:mStep refM { state := q, head := hd, left := L, right := R } = none⊢ match none with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂' exact absurd (zf393Trans_eq_none_of_mStep_none e)
(fiveStepLRLR_not_none q hd h5a) All goals completed! 🐙
· false.true.some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, lrlrP1 ↑q)h2:zf380Trans (↑(lrlrP1 ↑q)) L.mBit = some (L.mBit, Dir.right, lrlrS1 ↑q)h3':zf380Trans (↑(lrlrS1 ↑q)) hd = some (hd, Dir.left, lrlrP2 ↑q)h4:zf380Trans (↑(lrlrP2 ↑q)) L.mBit = some (L.mBit, Dir.right, lrlrS2 ↑q)hstep5:mStep candM { state := lrlrS2 ↑q, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(mStep refM { state := q, head := hd, left := L, right := R })c:MCfg 393 Me:mStep refM { state := q, head := hd, left := L, right := R } = some c⊢ match some c with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂' rw [e false.true.some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, lrlrP1 ↑q)h2:zf380Trans (↑(lrlrP1 ↑q)) L.mBit = some (L.mBit, Dir.right, lrlrS1 ↑q)h3':zf380Trans (↑(lrlrS1 ↑q)) hd = some (hd, Dir.left, lrlrP2 ↑q)h4:zf380Trans (↑(lrlrP2 ↑q)) L.mBit = some (L.mBit, Dir.right, lrlrS2 ↑q)c:MCfg 393 Mhstep5:mStep candM { state := lrlrS2 ↑q, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(some c)hpres:match some c with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truee:mStep refM { state := q, head := hd, left := L, right := R } = some c⊢ match some c with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'] at hpres hstep5 false.true.some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, lrlrP1 ↑q)h2:zf380Trans (↑(lrlrP1 ↑q)) L.mBit = some (L.mBit, Dir.right, lrlrS1 ↑q)h3':zf380Trans (↑(lrlrS1 ↑q)) hd = some (hd, Dir.left, lrlrP2 ↑q)h4:zf380Trans (↑(lrlrP2 ↑q)) L.mBit = some (L.mBit, Dir.right, lrlrS2 ↑q)c:MCfg 393 Mhstep5:mStep candM { state := lrlrS2 ↑q, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(some c)hpres:match some c with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truee:mStep refM { state := q, head := hd, left := L, right := R } = some c⊢ match some c with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
exact ⟨⟨4, by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = falseh5a:isFiveStepLRLR (↑q) hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, lrlrP1 ↑q)h2:zf380Trans (↑(lrlrP1 ↑q)) L.mBit = some (L.mBit, Dir.right, lrlrS1 ↑q)h3':zf380Trans (↑(lrlrS1 ↑q)) hd = some (hd, Dir.left, lrlrP2 ↑q)h4:zf380Trans (↑(lrlrP2 ↑q)) L.mBit = some (L.mBit, Dir.right, lrlrS2 ↑q)c:MCfg 393 Mhstep5:mStep candM { state := lrlrS2 ↑q, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(some c)hpres:match some c with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truee:mStep refM { state := q, head := hd, left := L, right := R } = some c⊢ 4 < 9 decide All goals completed! 🐙⟩, ⟨mapState c.state.val (mBit c.left) c.head,
c.head, c.left, c.right⟩, ⟨hpres, rfl⟩,
mStep_five_left_right h1 h2 h3' h4 hstep5⟩
· true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = true⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂' have h1 := transition_threeStep_1 q (mBit (mHalf L)) (mBit L) hd (mBit R) h3 hv1 true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, midP (↑q) hd)⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
have h2 := transition_threeStep_2 q (mBit (mHalf L)) (mBit L) hd (mBit R) h3 hv1 true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, midP (↑q) hd)h2:zf380Trans (↑(midP (↑q) hd)) L.mBit = some (L.mBit, Dir.right, midS (↑q) L.mBit hd)⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
have hstep3 := mStep_of_transition_eq hd L R
(transition_threeStep_3 q (mBit (mHalf L)) (mBit L) hd (mBit R) h3 hv1) true M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, midP (↑q) hd)h2:zf380Trans (↑(midP (↑q) hd)) L.mBit = some (L.mBit, Dir.right, midS (↑q) L.mBit hd)hstep3:mStep candM { state := midS (↑q) L.mBit hd, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(mStep refM { state := q, head := hd, left := L, right := R })⊢ match mStep refM { state := q, head := hd, left := L, right := R } with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
rcases e : mStep refM ⟨q, hd, L, R⟩ with _ | c true.none M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, midP (↑q) hd)h2:zf380Trans (↑(midP (↑q) hd)) L.mBit = some (L.mBit, Dir.right, midS (↑q) L.mBit hd)hstep3:mStep candM { state := midS (↑q) L.mBit hd, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(mStep refM { state := q, head := hd, left := L, right := R })e:mStep refM { state := q, head := hd, left := L, right := R } = none⊢ match none with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'true.some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, midP (↑q) hd)h2:zf380Trans (↑(midP (↑q) hd)) L.mBit = some (L.mBit, Dir.right, midS (↑q) L.mBit hd)hstep3:mStep candM { state := midS (↑q) L.mBit hd, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(mStep refM { state := q, head := hd, left := L, right := R })c:MCfg 393 Me:mStep refM { state := q, head := hd, left := L, right := R } = some c⊢ match some c with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
· true.none M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, midP (↑q) hd)h2:zf380Trans (↑(midP (↑q) hd)) L.mBit = some (L.mBit, Dir.right, midS (↑q) L.mBit hd)hstep3:mStep candM { state := midS (↑q) L.mBit hd, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(mStep refM { state := q, head := hd, left := L, right := R })e:mStep refM { state := q, head := hd, left := L, right := R } = none⊢ match none with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂' exact absurd (zf393Trans_eq_none_of_mStep_none e)
(threeStep_not_none q (mBit L) hd h3) All goals completed! 🐙
· true.some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehpres:match mStep refM { state := q, head := hd, left := L, right := R } with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, midP (↑q) hd)h2:zf380Trans (↑(midP (↑q) hd)) L.mBit = some (L.mBit, Dir.right, midS (↑q) L.mBit hd)hstep3:mStep candM { state := midS (↑q) L.mBit hd, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(mStep refM { state := q, head := hd, left := L, right := R })c:MCfg 393 Me:mStep refM { state := q, head := hd, left := L, right := R } = some c⊢ match some c with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂' rw [e true.some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, midP (↑q) hd)h2:zf380Trans (↑(midP (↑q) hd)) L.mBit = some (L.mBit, Dir.right, midS (↑q) L.mBit hd)c:MCfg 393 Mhstep3:mStep candM { state := midS (↑q) L.mBit hd, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(some c)hpres:match some c with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truee:mStep refM { state := q, head := hd, left := L, right := R } = some c⊢ match some c with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'] at hpres hstep3 true.some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, midP (↑q) hd)h2:zf380Trans (↑(midP (↑q) hd)) L.mBit = some (L.mBit, Dir.right, midS (↑q) L.mBit hd)c:MCfg 393 Mhstep3:mStep candM { state := midS (↑q) L.mBit hd, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(some c)hpres:match some c with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truee:mStep refM { state := q, head := hd, left := L, right := R } = some c⊢ match some c with
| none =>
mStep candM
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
none
| some c₁' =>
∃ k c₂',
MRel c₁' c₂' ∧
mNSteps candM (↑k + 1)
{
state :=
mapState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mBit
{ state := q, head := hd, left := L, right := R }.head,
head := { state := q, head := hd, left := L, right := R }.head,
left := { state := q, head := hd, left := L, right := R }.left,
right := { state := q, head := hd, left := L, right := R }.right } =
some c₂'
exact ⟨⟨2, by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Mq:Fin 393hd:Fin 2L:PAM MR:PAM Mhv:validState ↑{ state := q, head := hd, left := L, right := R }.state
{ state := q, head := hd, left := L, right := R }.left.mHalf.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mHalf.mBit
{ state := q, head := hd, left := L, right := R }.left.mBit { state := q, head := hd, left := L, right := R }.head
{ state := q, head := hd, left := L, right := R }.right.mBit =
truehv1:validState1 (↑q) L.mHalf.mBit L.mBit hd R.mBit = trueh3:isThreeStep (↑q) L.mBit hd = trueh1:zf380Trans (↑(mapState (↑q) L.mBit hd)) hd = some (hd, Dir.left, midP (↑q) hd)h2:zf380Trans (↑(midP (↑q) hd)) L.mBit = some (L.mBit, Dir.right, midS (↑q) L.mBit hd)c:MCfg 393 Mhstep3:mStep candM { state := midS (↑q) L.mBit hd, head := hd, left := L, right := R } =
Option.map
(fun c ↦ { state := mapState (↑c.state) c.left.mBit c.head, head := c.head, left := c.left, right := c.right })
(some c)hpres:match some c with
| none => True
| some c => validState (↑c.state) c.left.mHalf.mHalf.mBit c.left.mHalf.mBit c.left.mBit c.head c.right.mBit = truee:mStep refM { state := q, head := hd, left := L, right := R } = some c⊢ 2 < 9 decide All goals completed! 🐙⟩, ⟨mapState c.state.val (mBit c.left) c.head,
c.head, c.left, c.right⟩, ⟨hpres, rfl⟩,
mStep_three_left_right h1 h2 hstep3⟩
Section 3: Bidirectional Trace Simulation in PAM M
Forward trace simulation: if MRel a₁ a₂ and refM (zf_393) halts from a₁, then candM
(zf_380) halts from a₂.
theorem mHaltsFrom_cand_of_ref {a₁ : MCfg 393 M} {a₂ : MCfg 380 M}
(hrel₀ : MRel a₁ a₂) (hhalts : mHaltsFrom refM a₁) :
mHaltsFrom candM a₂ := by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂hhalts:mHaltsFrom refM a₁⊢ mHaltsFrom candM a₂
rcases hhalts with ⟨N, f₁, ⟨c₀, d₀, h0, hsteps, hN⟩, hnone⟩ M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁⊢ mHaltsFrom candM a₂
have hdef : PADef1 (fun i : PAM M ↦ i ≤ N →
∃ n₂ x₂ : PAM M,
(∃ (b₁ : MCfg 393 M) (b₂ : MCfg 380 M),
mBeta c₀ d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
(∃ (u₂ b₂ : MCfg 380 M),
mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂)) := by
have hi_le : PADefN 1 (fun u ↦ u 0 ≤ N) := paDef_le (paFun_proj 0) (paFun_const N) M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hi_le:PADefN 1 fun u ↦ u 0 ≤ N⊢ PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂
let fn₂ : (Fin 3 → PAM M) → PAM M := fun w ↦ w 1 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hi_le:PADefN 1 fun u ↦ u 0 ≤ Nfn₂:(Fin 3 → PAM M) → PAM M := fun w ↦ w 1⊢ PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂
let fx₂ : (Fin 3 → PAM M) → PAM M := fun w ↦ w 2 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hi_le:PADefN 1 fun u ↦ u 0 ≤ Nfn₂:(Fin 3 → PAM M) → PAM M := fun w ↦ w 1fx₂:(Fin 3 → PAM M) → PAM M := fun w ↦ w 2⊢ PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂
let fbi : (Fin 3 → PAM M) → PAM M := fun w ↦ mBeta c₀ d₀ (w 0) M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hi_le:PADefN 1 fun u ↦ u 0 ≤ Nfn₂:(Fin 3 → PAM M) → PAM M := fun w ↦ w 1fx₂:(Fin 3 → PAM M) → PAM M := fun w ↦ w 2fbi:(Fin 3 → PAM M) → PAM M := fun w ↦ c₀.mBeta d₀ (w 0)⊢ PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂
have hn₂ : PAFunN 3 fn₂ := paFun_proj 1 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hi_le:PADefN 1 fun u ↦ u 0 ≤ Nfn₂:(Fin 3 → PAM M) → PAM M := fun w ↦ w 1fx₂:(Fin 3 → PAM M) → PAM M := fun w ↦ w 2fbi:(Fin 3 → PAM M) → PAM M := fun w ↦ c₀.mBeta d₀ (w 0)hn₂:PAFunN 3 fn₂⊢ PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂
have hx₂ : PAFunN 3 fx₂ := paFun_proj 2 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hi_le:PADefN 1 fun u ↦ u 0 ≤ Nfn₂:(Fin 3 → PAM M) → PAM M := fun w ↦ w 1fx₂:(Fin 3 → PAM M) → PAM M := fun w ↦ w 2fbi:(Fin 3 → PAM M) → PAM M := fun w ↦ c₀.mBeta d₀ (w 0)hn₂:PAFunN 3 fn₂hx₂:PAFunN 3 fx₂⊢ PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂
have hbi : PAFunN 3 fbi := paFun_mBeta (paFun_const c₀) (paFun_const d₀) (paFun_proj 0) M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hi_le:PADefN 1 fun u ↦ u 0 ≤ Nfn₂:(Fin 3 → PAM M) → PAM M := fun w ↦ w 1fx₂:(Fin 3 → PAM M) → PAM M := fun w ↦ w 2fbi:(Fin 3 → PAM M) → PAM M := fun w ↦ c₀.mBeta d₀ (w 0)hn₂:PAFunN 3 fn₂hx₂:PAFunN 3 fx₂hbi:PAFunN 3 fbi⊢ PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂
have hbody := paDef_and (paDef_mRelCode hbi hx₂)
(paDef_mTracesToCode candM hn₂ (paFun_const (mEncodeCfg a₂)) hx₂) M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hi_le:PADefN 1 fun u ↦ u 0 ≤ Nfn₂:(Fin 3 → PAM M) → PAM M := fun w ↦ w 1fx₂:(Fin 3 → PAM M) → PAM M := fun w ↦ w 2fbi:(Fin 3 → PAM M) → PAM M := fun w ↦ c₀.mBeta d₀ (w 0)hn₂:PAFunN 3 fn₂hx₂:PAFunN 3 fx₂hbi:PAFunN 3 fbihbody:PADefN 3 fun args ↦
(∃ c₁ c₂, fbi args = mEncodeCfg c₁ ∧ fx₂ args = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
∃ a b, mEncodeCfg a₂ = mEncodeCfg a ∧ fx₂ args = mEncodeCfg b ∧ mTracesTo candM (fn₂ args) a b⊢ PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂
refine paDefN_congr (fun u ↦ ?_) (paDef_imp hi_le (paDef_ex (paDef_ex hbody))) M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hi_le:PADefN 1 fun u ↦ u 0 ≤ Nfn₂:(Fin 3 → PAM M) → PAM M := fun w ↦ w 1fx₂:(Fin 3 → PAM M) → PAM M := fun w ↦ w 2fbi:(Fin 3 → PAM M) → PAM M := fun w ↦ c₀.mBeta d₀ (w 0)hn₂:PAFunN 3 fn₂hx₂:PAFunN 3 fx₂hbi:PAFunN 3 fbihbody:PADefN 3 fun args ↦
(∃ c₁ c₂, fbi args = mEncodeCfg c₁ ∧ fx₂ args = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
∃ a b, mEncodeCfg a₂ = mEncodeCfg a ∧ fx₂ args = mEncodeCfg b ∧ mTracesTo candM (fn₂ args) a bu:Fin 1 → PAM M⊢ (u 0 ≤ N →
∃ a a_1,
(∃ c₁ c₂,
fbi (Fin.snoc (Fin.snoc u a) a_1) = mEncodeCfg c₁ ∧
fx₂ (Fin.snoc (Fin.snoc u a) a_1) = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
∃ a_2 b,
mEncodeCfg a₂ = mEncodeCfg a_2 ∧
fx₂ (Fin.snoc (Fin.snoc u a) a_1) = mEncodeCfg b ∧
mTracesTo candM (fn₂ (Fin.snoc (Fin.snoc u a) a_1)) a_2 b) ↔
(fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂)
(u 0)
refine imp_congr Iff.rfl (exists_congr fun n₂ ↦ exists_congr fun x₂ ↦ ?_) M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hi_le:PADefN 1 fun u ↦ u 0 ≤ Nfn₂:(Fin 3 → PAM M) → PAM M := fun w ↦ w 1fx₂:(Fin 3 → PAM M) → PAM M := fun w ↦ w 2fbi:(Fin 3 → PAM M) → PAM M := fun w ↦ c₀.mBeta d₀ (w 0)hn₂:PAFunN 3 fn₂hx₂:PAFunN 3 fx₂hbi:PAFunN 3 fbihbody:PADefN 3 fun args ↦
(∃ c₁ c₂, fbi args = mEncodeCfg c₁ ∧ fx₂ args = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
∃ a b, mEncodeCfg a₂ = mEncodeCfg a ∧ fx₂ args = mEncodeCfg b ∧ mTracesTo candM (fn₂ args) a bu:Fin 1 → PAM Mn₂:PAM Mx₂:PAM M⊢ ((∃ c₁ c₂,
fbi (Fin.snoc (Fin.snoc u n₂) x₂) = mEncodeCfg c₁ ∧
fx₂ (Fin.snoc (Fin.snoc u n₂) x₂) = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
∃ a b,
mEncodeCfg a₂ = mEncodeCfg a ∧
fx₂ (Fin.snoc (Fin.snoc u n₂) x₂) = mEncodeCfg b ∧ mTracesTo candM (fn₂ (Fin.snoc (Fin.snoc u n₂) x₂)) a b) ↔
(∃ b₁ b₂, c₀.mBeta d₀ (u 0) = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂
dsimp only [fn₂, fx₂, fbi] M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hi_le:PADefN 1 fun u ↦ u 0 ≤ Nfn₂:(Fin 3 → PAM M) → PAM M := fun w ↦ w 1fx₂:(Fin 3 → PAM M) → PAM M := fun w ↦ w 2fbi:(Fin 3 → PAM M) → PAM M := fun w ↦ c₀.mBeta d₀ (w 0)hn₂:PAFunN 3 fn₂hx₂:PAFunN 3 fx₂hbi:PAFunN 3 fbihbody:PADefN 3 fun args ↦
(∃ c₁ c₂, fbi args = mEncodeCfg c₁ ∧ fx₂ args = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
∃ a b, mEncodeCfg a₂ = mEncodeCfg a ∧ fx₂ args = mEncodeCfg b ∧ mTracesTo candM (fn₂ args) a bu:Fin 1 → PAM Mn₂:PAM Mx₂:PAM M⊢ ((∃ c₁ c₂,
c₀.mBeta d₀ (Fin.snoc (Fin.snoc u n₂) x₂ 0) = mEncodeCfg c₁ ∧
Fin.snoc (Fin.snoc u n₂) x₂ 2 = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
∃ a b,
mEncodeCfg a₂ = mEncodeCfg a ∧
Fin.snoc (Fin.snoc u n₂) x₂ 2 = mEncodeCfg b ∧ mTracesTo candM (Fin.snoc (Fin.snoc u n₂) x₂ 1) a b) ↔
(∃ b₁ b₂, c₀.mBeta d₀ (u 0) = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂
simp [Fin.snoc] M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hdef:PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂⊢ mHaltsFrom candM a₂
have hsim := ind1 hdef ?_ ?_ N le_rfl refine_3 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hdef:PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂hsim:∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ N = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂⊢ mHaltsFrom candM a₂refine_1 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hdef:PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂⊢ 0 ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ 0 = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂refine_2 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hdef:PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂⊢ ∀ (a : PAM M),
(a ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ a = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂) →
a + 1 ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ (a + 1) = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂
· refine_3 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hdef:PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂hsim:∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ N = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂⊢ mHaltsFrom candM a₂ rcases hsim with ⟨n₂, x₂, ⟨b₁, b₂, hb₁, hx₂, hrel⟩, ⟨u₂, b₂', hu₂, hx₂', htr₂⟩⟩ refine_3 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hdef:PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂n₂:PAM Mx₂:PAM Mb₁:MCfg 393 Mb₂:MCfg 380 Mhb₁:c₀.mBeta d₀ N = mEncodeCfg b₁hx₂:x₂ = mEncodeCfg b₂hrel:MRel b₁ b₂u₂:MCfg 380 Mb₂':MCfg 380 Mhu₂:mEncodeCfg a₂ = mEncodeCfg u₂hx₂':x₂ = mEncodeCfg b₂'htr₂:mTracesTo candM n₂ u₂ b₂'⊢ mHaltsFrom candM a₂
have hb₁f : b₁ = f₁ := mEncodeCfg_injective (hb₁.symm.trans hN) refine_3 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hdef:PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂n₂:PAM Mx₂:PAM Mb₁:MCfg 393 Mb₂:MCfg 380 Mhb₁:c₀.mBeta d₀ N = mEncodeCfg b₁hx₂:x₂ = mEncodeCfg b₂hrel:MRel b₁ b₂u₂:MCfg 380 Mb₂':MCfg 380 Mhu₂:mEncodeCfg a₂ = mEncodeCfg u₂hx₂':x₂ = mEncodeCfg b₂'htr₂:mTracesTo candM n₂ u₂ b₂'hb₁f:b₁ = f₁⊢ mHaltsFrom candM a₂
have hu₂a : u₂ = a₂ := mEncodeCfg_injective hu₂.symm refine_3 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hdef:PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂n₂:PAM Mx₂:PAM Mb₁:MCfg 393 Mb₂:MCfg 380 Mhb₁:c₀.mBeta d₀ N = mEncodeCfg b₁hx₂:x₂ = mEncodeCfg b₂hrel:MRel b₁ b₂u₂:MCfg 380 Mb₂':MCfg 380 Mhu₂:mEncodeCfg a₂ = mEncodeCfg u₂hx₂':x₂ = mEncodeCfg b₂'htr₂:mTracesTo candM n₂ u₂ b₂'hb₁f:b₁ = f₁hu₂a:u₂ = a₂⊢ mHaltsFrom candM a₂
have hb₂eq : b₂' = b₂ := mEncodeCfg_injective (hx₂'.symm.trans hx₂) refine_3 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hdef:PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂n₂:PAM Mx₂:PAM Mb₁:MCfg 393 Mb₂:MCfg 380 Mhb₁:c₀.mBeta d₀ N = mEncodeCfg b₁hx₂:x₂ = mEncodeCfg b₂hrel:MRel b₁ b₂u₂:MCfg 380 Mb₂':MCfg 380 Mhu₂:mEncodeCfg a₂ = mEncodeCfg u₂hx₂':x₂ = mEncodeCfg b₂'htr₂:mTracesTo candM n₂ u₂ b₂'hb₁f:b₁ = f₁hu₂a:u₂ = a₂hb₂eq:b₂' = b₂⊢ mHaltsFrom candM a₂
subst b₁ u₂ b₂' refine_3 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hdef:PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂n₂:PAM Mx₂:PAM Mb₂:MCfg 380 Mhx₂:x₂ = mEncodeCfg b₂hb₁:c₀.mBeta d₀ N = mEncodeCfg f₁hrel:MRel f₁ b₂hu₂:mEncodeCfg a₂ = mEncodeCfg a₂hx₂':x₂ = mEncodeCfg b₂htr₂:mTracesTo candM n₂ a₂ b₂⊢ mHaltsFrom candM a₂
have hres := mRespects hrel refine_3 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hdef:PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂n₂:PAM Mx₂:PAM Mb₂:MCfg 380 Mhx₂:x₂ = mEncodeCfg b₂hb₁:c₀.mBeta d₀ N = mEncodeCfg f₁hrel:MRel f₁ b₂hu₂:mEncodeCfg a₂ = mEncodeCfg a₂hx₂':x₂ = mEncodeCfg b₂htr₂:mTracesTo candM n₂ a₂ b₂hres:match mStep refM f₁ with
| none => mStep candM b₂ = none
| some c₁' => ∃ k c₂', MRel c₁' c₂' ∧ mNSteps candM (↑k + 1) b₂ = some c₂'⊢ mHaltsFrom candM a₂
rw [hnone refine_3 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hdef:PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂n₂:PAM Mx₂:PAM Mb₂:MCfg 380 Mhx₂:x₂ = mEncodeCfg b₂hb₁:c₀.mBeta d₀ N = mEncodeCfg f₁hrel:MRel f₁ b₂hu₂:mEncodeCfg a₂ = mEncodeCfg a₂hx₂':x₂ = mEncodeCfg b₂htr₂:mTracesTo candM n₂ a₂ b₂hres:match none with
| none => mStep candM b₂ = none
| some c₁' => ∃ k c₂', MRel c₁' c₂' ∧ mNSteps candM (↑k + 1) b₂ = some c₂'⊢ mHaltsFrom candM a₂] at hres refine_3 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hdef:PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂n₂:PAM Mx₂:PAM Mb₂:MCfg 380 Mhx₂:x₂ = mEncodeCfg b₂hb₁:c₀.mBeta d₀ N = mEncodeCfg f₁hrel:MRel f₁ b₂hu₂:mEncodeCfg a₂ = mEncodeCfg a₂hx₂':x₂ = mEncodeCfg b₂htr₂:mTracesTo candM n₂ a₂ b₂hres:match none with
| none => mStep candM b₂ = none
| some c₁' => ∃ k c₂', MRel c₁' c₂' ∧ mNSteps candM (↑k + 1) b₂ = some c₂'⊢ mHaltsFrom candM a₂
exact ⟨n₂, b₂, htr₂, hres⟩ All goals completed! 🐙
· refine_1 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hdef:PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂⊢ 0 ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ 0 = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂ intro _ refine_1 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hdef:PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂a✝:0 ≤ N⊢ ∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ 0 = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂
exact ⟨0, mEncodeCfg a₂, ⟨a₁, a₂, h0, rfl, hrel₀⟩,
⟨a₂, a₂, rfl, rfl, mTracesTo_zero candM a₂⟩⟩ All goals completed! 🐙
· refine_2 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hdef:PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂⊢ ∀ (a : PAM M),
(a ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ a = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂) →
a + 1 ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ (a + 1) = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂ intro i ih hi1 refine_2 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hdef:PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂i:PAM Mih:i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂hi1:i + 1 ≤ N⊢ ∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂
have hilt : i < N := hi1 refine_2 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hdef:PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂i:PAM Mih:i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂hi1:i + 1 ≤ Nhilt:i < N⊢ ∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂
rcases ih (le_of_lt hilt) with ⟨n₂, x₂, ⟨b₁, b₂, hb₁, hx₂, hrel⟩, ⟨u₂, b₂', hu₂, hx₂', htr₂⟩⟩ refine_2 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hdef:PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂i:PAM Mih:i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂hi1:i + 1 ≤ Nhilt:i < Nn₂:PAM Mx₂:PAM Mb₁:MCfg 393 Mb₂:MCfg 380 Mhb₁:c₀.mBeta d₀ i = mEncodeCfg b₁hx₂:x₂ = mEncodeCfg b₂hrel:MRel b₁ b₂u₂:MCfg 380 Mb₂':MCfg 380 Mhu₂:mEncodeCfg a₂ = mEncodeCfg u₂hx₂':x₂ = mEncodeCfg b₂'htr₂:mTracesTo candM n₂ u₂ b₂'⊢ ∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂
have hu₂a : u₂ = a₂ := mEncodeCfg_injective hu₂.symm refine_2 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hdef:PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂i:PAM Mih:i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂hi1:i + 1 ≤ Nhilt:i < Nn₂:PAM Mx₂:PAM Mb₁:MCfg 393 Mb₂:MCfg 380 Mhb₁:c₀.mBeta d₀ i = mEncodeCfg b₁hx₂:x₂ = mEncodeCfg b₂hrel:MRel b₁ b₂u₂:MCfg 380 Mb₂':MCfg 380 Mhu₂:mEncodeCfg a₂ = mEncodeCfg u₂hx₂':x₂ = mEncodeCfg b₂'htr₂:mTracesTo candM n₂ u₂ b₂'hu₂a:u₂ = a₂⊢ ∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂
have hb₂eq : b₂' = b₂ := mEncodeCfg_injective (hx₂'.symm.trans hx₂) refine_2 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hdef:PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂i:PAM Mih:i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂hi1:i + 1 ≤ Nhilt:i < Nn₂:PAM Mx₂:PAM Mb₁:MCfg 393 Mb₂:MCfg 380 Mhb₁:c₀.mBeta d₀ i = mEncodeCfg b₁hx₂:x₂ = mEncodeCfg b₂hrel:MRel b₁ b₂u₂:MCfg 380 Mb₂':MCfg 380 Mhu₂:mEncodeCfg a₂ = mEncodeCfg u₂hx₂':x₂ = mEncodeCfg b₂'htr₂:mTracesTo candM n₂ u₂ b₂'hu₂a:u₂ = a₂hb₂eq:b₂' = b₂⊢ ∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂
subst u₂ b₂' refine_2 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hdef:PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂i:PAM Mih:i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂hi1:i + 1 ≤ Nhilt:i < Nn₂:PAM Mx₂:PAM Mb₁:MCfg 393 Mb₂:MCfg 380 Mhb₁:c₀.mBeta d₀ i = mEncodeCfg b₁hx₂:x₂ = mEncodeCfg b₂hrel:MRel b₁ b₂hu₂:mEncodeCfg a₂ = mEncodeCfg a₂hx₂':x₂ = mEncodeCfg b₂htr₂:mTracesTo candM n₂ a₂ b₂⊢ ∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂
obtain ⟨p₁, q₁, hp₁, hq₁, hst₁⟩ := hsteps i hilt refine_2 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hdef:PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂i:PAM Mih:i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂hi1:i + 1 ≤ Nhilt:i < Nn₂:PAM Mx₂:PAM Mb₁:MCfg 393 Mb₂:MCfg 380 Mhb₁:c₀.mBeta d₀ i = mEncodeCfg b₁hx₂:x₂ = mEncodeCfg b₂hrel:MRel b₁ b₂hu₂:mEncodeCfg a₂ = mEncodeCfg a₂hx₂':x₂ = mEncodeCfg b₂htr₂:mTracesTo candM n₂ a₂ b₂p₁:MCfg 393 Mq₁:MCfg 393 Mhp₁:c₀.mBeta d₀ i = mEncodeCfg p₁hq₁:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₁hst₁:mStep refM p₁ = some q₁⊢ ∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂
have hp₁b : p₁ = b₁ := mEncodeCfg_injective (hp₁.symm.trans hb₁) refine_2 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hdef:PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂i:PAM Mih:i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂hi1:i + 1 ≤ Nhilt:i < Nn₂:PAM Mx₂:PAM Mb₁:MCfg 393 Mb₂:MCfg 380 Mhb₁:c₀.mBeta d₀ i = mEncodeCfg b₁hx₂:x₂ = mEncodeCfg b₂hrel:MRel b₁ b₂hu₂:mEncodeCfg a₂ = mEncodeCfg a₂hx₂':x₂ = mEncodeCfg b₂htr₂:mTracesTo candM n₂ a₂ b₂p₁:MCfg 393 Mq₁:MCfg 393 Mhp₁:c₀.mBeta d₀ i = mEncodeCfg p₁hq₁:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₁hst₁:mStep refM p₁ = some q₁hp₁b:p₁ = b₁⊢ ∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂
subst p₁ refine_2 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hdef:PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂i:PAM Mih:i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂hi1:i + 1 ≤ Nhilt:i < Nn₂:PAM Mx₂:PAM Mb₁:MCfg 393 Mb₂:MCfg 380 Mhb₁:c₀.mBeta d₀ i = mEncodeCfg b₁hx₂:x₂ = mEncodeCfg b₂hrel:MRel b₁ b₂hu₂:mEncodeCfg a₂ = mEncodeCfg a₂hx₂':x₂ = mEncodeCfg b₂htr₂:mTracesTo candM n₂ a₂ b₂q₁:MCfg 393 Mhq₁:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₁hp₁:c₀.mBeta d₀ i = mEncodeCfg b₁hst₁:mStep refM b₁ = some q₁⊢ ∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂
have hres := mRespects hrel refine_2 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hdef:PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂i:PAM Mih:i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂hi1:i + 1 ≤ Nhilt:i < Nn₂:PAM Mx₂:PAM Mb₁:MCfg 393 Mb₂:MCfg 380 Mhb₁:c₀.mBeta d₀ i = mEncodeCfg b₁hx₂:x₂ = mEncodeCfg b₂hrel:MRel b₁ b₂hu₂:mEncodeCfg a₂ = mEncodeCfg a₂hx₂':x₂ = mEncodeCfg b₂htr₂:mTracesTo candM n₂ a₂ b₂q₁:MCfg 393 Mhq₁:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₁hp₁:c₀.mBeta d₀ i = mEncodeCfg b₁hst₁:mStep refM b₁ = some q₁hres:match mStep refM b₁ with
| none => mStep candM b₂ = none
| some c₁' => ∃ k c₂', MRel c₁' c₂' ∧ mNSteps candM (↑k + 1) b₂ = some c₂'⊢ ∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂
rw [hst₁ refine_2 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hdef:PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂i:PAM Mih:i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂hi1:i + 1 ≤ Nhilt:i < Nn₂:PAM Mx₂:PAM Mb₁:MCfg 393 Mb₂:MCfg 380 Mhb₁:c₀.mBeta d₀ i = mEncodeCfg b₁hx₂:x₂ = mEncodeCfg b₂hrel:MRel b₁ b₂hu₂:mEncodeCfg a₂ = mEncodeCfg a₂hx₂':x₂ = mEncodeCfg b₂htr₂:mTracesTo candM n₂ a₂ b₂q₁:MCfg 393 Mhq₁:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₁hp₁:c₀.mBeta d₀ i = mEncodeCfg b₁hst₁:mStep refM b₁ = some q₁hres:match some q₁ with
| none => mStep candM b₂ = none
| some c₁' => ∃ k c₂', MRel c₁' c₂' ∧ mNSteps candM (↑k + 1) b₂ = some c₂'⊢ ∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂] at hres refine_2 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hdef:PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂i:PAM Mih:i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂hi1:i + 1 ≤ Nhilt:i < Nn₂:PAM Mx₂:PAM Mb₁:MCfg 393 Mb₂:MCfg 380 Mhb₁:c₀.mBeta d₀ i = mEncodeCfg b₁hx₂:x₂ = mEncodeCfg b₂hrel:MRel b₁ b₂hu₂:mEncodeCfg a₂ = mEncodeCfg a₂hx₂':x₂ = mEncodeCfg b₂htr₂:mTracesTo candM n₂ a₂ b₂q₁:MCfg 393 Mhq₁:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₁hp₁:c₀.mBeta d₀ i = mEncodeCfg b₁hst₁:mStep refM b₁ = some q₁hres:match some q₁ with
| none => mStep candM b₂ = none
| some c₁' => ∃ k c₂', MRel c₁' c₂' ∧ mNSteps candM (↑k + 1) b₂ = some c₂'⊢ ∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂
rcases hres with ⟨k, c₂', hrel', hns⟩ refine_2 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hdef:PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂i:PAM Mih:i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂hi1:i + 1 ≤ Nhilt:i < Nn₂:PAM Mx₂:PAM Mb₁:MCfg 393 Mb₂:MCfg 380 Mhb₁:c₀.mBeta d₀ i = mEncodeCfg b₁hx₂:x₂ = mEncodeCfg b₂hrel:MRel b₁ b₂hu₂:mEncodeCfg a₂ = mEncodeCfg a₂hx₂':x₂ = mEncodeCfg b₂htr₂:mTracesTo candM n₂ a₂ b₂q₁:MCfg 393 Mhq₁:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₁hp₁:c₀.mBeta d₀ i = mEncodeCfg b₁hst₁:mStep refM b₁ = some q₁k:Fin 9c₂':MCfg 380 Mhrel':MRel q₁ c₂'hns:mNSteps candM (↑k + 1) b₂ = some c₂'⊢ ∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂
have htr_step := mTracesTo_of_mNSteps (M := M) hns refine_2 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₁:MCfg 393 Mhnone:mStep refM f₁ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₁hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep refM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₁hdef:PADef1 fun i ↦
i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂i:PAM Mih:i ≤ N →
∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ i = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂hi1:i + 1 ≤ Nhilt:i < Nn₂:PAM Mx₂:PAM Mb₁:MCfg 393 Mb₂:MCfg 380 Mhb₁:c₀.mBeta d₀ i = mEncodeCfg b₁hx₂:x₂ = mEncodeCfg b₂hrel:MRel b₁ b₂hu₂:mEncodeCfg a₂ = mEncodeCfg a₂hx₂':x₂ = mEncodeCfg b₂htr₂:mTracesTo candM n₂ a₂ b₂q₁:MCfg 393 Mhq₁:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₁hp₁:c₀.mBeta d₀ i = mEncodeCfg b₁hst₁:mStep refM b₁ = some q₁k:Fin 9c₂':MCfg 380 Mhrel':MRel q₁ c₂'hns:mNSteps candM (↑k + 1) b₂ = some c₂'htr_step:mTracesTo candM (↑(↑k + 1)) b₂ c₂'⊢ ∃ n₂ x₂,
(∃ b₁ b₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₁ ∧ x₂ = mEncodeCfg b₂ ∧ MRel b₁ b₂) ∧
∃ u₂ b₂, mEncodeCfg a₂ = mEncodeCfg u₂ ∧ x₂ = mEncodeCfg b₂ ∧ mTracesTo candM n₂ u₂ b₂
exact ⟨n₂ + ((k.val + 1 : ℕ) : PAM M), mEncodeCfg c₂',
⟨q₁, c₂', hq₁, rfl, hrel'⟩,
⟨a₂, c₂', rfl, rfl, mTracesTo_trans htr₂ htr_step⟩⟩ All goals completed! 🐙
Backward trace simulation: if MRel a₁ a₂ and candM (zf_380) halts from a₂, then refM
(zf_393) halts from a₁.
theorem mHaltsFrom_ref_of_cand {a₁ : MCfg 393 M} {a₂ : MCfg 380 M}
(hrel₀ : MRel a₁ a₂) (hhalts : mHaltsFrom candM a₂) :
mHaltsFrom refM a₁ := by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂hhalts:mHaltsFrom candM a₂⊢ mHaltsFrom refM a₁
rcases hhalts with ⟨N, f₂, ⟨c₀, d₀, h0, hsteps, hN⟩, hnone⟩ M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂⊢ mHaltsFrom refM a₁
have hdef : PADef1 (fun i : PAM M ↦ i ≤ N →
∃ (r : Fin 9) (n₁ x₁ x₂ : PAM M),
(∃ (c₁ : MCfg 393 M) (c₂ : MCfg 380 M),
x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ (u₁ c₁ : MCfg 393 M),
mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
(∃ (b₂ c₂ : MCfg 380 M),
mBeta c₀ d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧
mTracesTo candM (r.val : PAM M) b₂ c₂)) := by
have hi_le : PADefN 1 (fun u ↦ u 0 ≤ N) := paDef_le (paFun_proj 0) (paFun_const N) M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hi_le:PADefN 1 fun u ↦ u 0 ≤ N⊢ PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
have hr_case : ∀ r : Fin 9, PADefN 1 (fun u ↦
∃ n₁ x₁ x₂ : PAM M,
(∃ (c₁ : MCfg 393 M) (c₂ : MCfg 380 M),
x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ (u₁ c₁ : MCfg 393 M),
mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
(∃ (b₂ c₂ : MCfg 380 M),
mBeta c₀ d₀ (u 0) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧
mTracesTo candM (r.val : PAM M) b₂ c₂)) := by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂hhalts:mHaltsFrom candM a₂⊢ mHaltsFrom refM a₁
intro r M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hi_le:PADefN 1 fun u ↦ u 0 ≤ Nr:Fin 9⊢ PADefN 1 fun u ↦
∃ n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (u 0) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
let fn₁ : (Fin 4 → PAM M) → PAM M := fun w ↦ w 1 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hi_le:PADefN 1 fun u ↦ u 0 ≤ Nr:Fin 9fn₁:(Fin 4 → PAM M) → PAM M := fun w ↦ w 1⊢ PADefN 1 fun u ↦
∃ n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (u 0) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
let fx₁ : (Fin 4 → PAM M) → PAM M := fun w ↦ w 2 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hi_le:PADefN 1 fun u ↦ u 0 ≤ Nr:Fin 9fn₁:(Fin 4 → PAM M) → PAM M := fun w ↦ w 1fx₁:(Fin 4 → PAM M) → PAM M := fun w ↦ w 2⊢ PADefN 1 fun u ↦
∃ n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (u 0) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
let fx₂ : (Fin 4 → PAM M) → PAM M := fun w ↦ w 3 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hi_le:PADefN 1 fun u ↦ u 0 ≤ Nr:Fin 9fn₁:(Fin 4 → PAM M) → PAM M := fun w ↦ w 1fx₁:(Fin 4 → PAM M) → PAM M := fun w ↦ w 2fx₂:(Fin 4 → PAM M) → PAM M := fun w ↦ w 3⊢ PADefN 1 fun u ↦
∃ n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (u 0) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
let fbi : (Fin 4 → PAM M) → PAM M := fun w ↦ mBeta c₀ d₀ (w 0) M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hi_le:PADefN 1 fun u ↦ u 0 ≤ Nr:Fin 9fn₁:(Fin 4 → PAM M) → PAM M := fun w ↦ w 1fx₁:(Fin 4 → PAM M) → PAM M := fun w ↦ w 2fx₂:(Fin 4 → PAM M) → PAM M := fun w ↦ w 3fbi:(Fin 4 → PAM M) → PAM M := fun w ↦ c₀.mBeta d₀ (w 0)⊢ PADefN 1 fun u ↦
∃ n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (u 0) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
have hn₁ : PAFunN 4 fn₁ := paFun_proj 1 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hi_le:PADefN 1 fun u ↦ u 0 ≤ Nr:Fin 9fn₁:(Fin 4 → PAM M) → PAM M := fun w ↦ w 1fx₁:(Fin 4 → PAM M) → PAM M := fun w ↦ w 2fx₂:(Fin 4 → PAM M) → PAM M := fun w ↦ w 3fbi:(Fin 4 → PAM M) → PAM M := fun w ↦ c₀.mBeta d₀ (w 0)hn₁:PAFunN 4 fn₁⊢ PADefN 1 fun u ↦
∃ n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (u 0) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
have hx₁ : PAFunN 4 fx₁ := paFun_proj 2 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hi_le:PADefN 1 fun u ↦ u 0 ≤ Nr:Fin 9fn₁:(Fin 4 → PAM M) → PAM M := fun w ↦ w 1fx₁:(Fin 4 → PAM M) → PAM M := fun w ↦ w 2fx₂:(Fin 4 → PAM M) → PAM M := fun w ↦ w 3fbi:(Fin 4 → PAM M) → PAM M := fun w ↦ c₀.mBeta d₀ (w 0)hn₁:PAFunN 4 fn₁hx₁:PAFunN 4 fx₁⊢ PADefN 1 fun u ↦
∃ n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (u 0) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
have hx₂ : PAFunN 4 fx₂ := paFun_proj 3 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hi_le:PADefN 1 fun u ↦ u 0 ≤ Nr:Fin 9fn₁:(Fin 4 → PAM M) → PAM M := fun w ↦ w 1fx₁:(Fin 4 → PAM M) → PAM M := fun w ↦ w 2fx₂:(Fin 4 → PAM M) → PAM M := fun w ↦ w 3fbi:(Fin 4 → PAM M) → PAM M := fun w ↦ c₀.mBeta d₀ (w 0)hn₁:PAFunN 4 fn₁hx₁:PAFunN 4 fx₁hx₂:PAFunN 4 fx₂⊢ PADefN 1 fun u ↦
∃ n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (u 0) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
have hbi : PAFunN 4 fbi := paFun_mBeta (paFun_const c₀) (paFun_const d₀) (paFun_proj 0) M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hi_le:PADefN 1 fun u ↦ u 0 ≤ Nr:Fin 9fn₁:(Fin 4 → PAM M) → PAM M := fun w ↦ w 1fx₁:(Fin 4 → PAM M) → PAM M := fun w ↦ w 2fx₂:(Fin 4 → PAM M) → PAM M := fun w ↦ w 3fbi:(Fin 4 → PAM M) → PAM M := fun w ↦ c₀.mBeta d₀ (w 0)hn₁:PAFunN 4 fn₁hx₁:PAFunN 4 fx₁hx₂:PAFunN 4 fx₂hbi:PAFunN 4 fbi⊢ PADefN 1 fun u ↦
∃ n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (u 0) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
have hbody := paDef_and (paDef_mRelCode hx₁ hx₂)
(paDef_and
(paDef_mTracesToCode refM hn₁ (paFun_const (mEncodeCfg a₁)) hx₁)
(paDef_mTracesToCode candM (paFun_const (r.val : PAM M)) hbi hx₂)) M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hi_le:PADefN 1 fun u ↦ u 0 ≤ Nr:Fin 9fn₁:(Fin 4 → PAM M) → PAM M := fun w ↦ w 1fx₁:(Fin 4 → PAM M) → PAM M := fun w ↦ w 2fx₂:(Fin 4 → PAM M) → PAM M := fun w ↦ w 3fbi:(Fin 4 → PAM M) → PAM M := fun w ↦ c₀.mBeta d₀ (w 0)hn₁:PAFunN 4 fn₁hx₁:PAFunN 4 fx₁hx₂:PAFunN 4 fx₂hbi:PAFunN 4 fbihbody:PADefN 4 fun args ↦
(∃ c₁ c₂, fx₁ args = mEncodeCfg c₁ ∧ fx₂ args = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ a b, mEncodeCfg a₁ = mEncodeCfg a ∧ fx₁ args = mEncodeCfg b ∧ mTracesTo refM (fn₁ args) a b) ∧
∃ a b, fbi args = mEncodeCfg a ∧ fx₂ args = mEncodeCfg b ∧ mTracesTo candM (↑↑r) a b⊢ PADefN 1 fun u ↦
∃ n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (u 0) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
refine paDefN_congr (fun u ↦ ?_) (paDef_ex (paDef_ex (paDef_ex hbody))) M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hi_le:PADefN 1 fun u ↦ u 0 ≤ Nr:Fin 9fn₁:(Fin 4 → PAM M) → PAM M := fun w ↦ w 1fx₁:(Fin 4 → PAM M) → PAM M := fun w ↦ w 2fx₂:(Fin 4 → PAM M) → PAM M := fun w ↦ w 3fbi:(Fin 4 → PAM M) → PAM M := fun w ↦ c₀.mBeta d₀ (w 0)hn₁:PAFunN 4 fn₁hx₁:PAFunN 4 fx₁hx₂:PAFunN 4 fx₂hbi:PAFunN 4 fbihbody:PADefN 4 fun args ↦
(∃ c₁ c₂, fx₁ args = mEncodeCfg c₁ ∧ fx₂ args = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ a b, mEncodeCfg a₁ = mEncodeCfg a ∧ fx₁ args = mEncodeCfg b ∧ mTracesTo refM (fn₁ args) a b) ∧
∃ a b, fbi args = mEncodeCfg a ∧ fx₂ args = mEncodeCfg b ∧ mTracesTo candM (↑↑r) a bu:Fin 1 → PAM M⊢ (∃ a a_1 a_2,
(∃ c₁ c₂,
fx₁ (Fin.snoc (Fin.snoc (Fin.snoc u a) a_1) a_2) = mEncodeCfg c₁ ∧
fx₂ (Fin.snoc (Fin.snoc (Fin.snoc u a) a_1) a_2) = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ a_3 b,
mEncodeCfg a₁ = mEncodeCfg a_3 ∧
fx₁ (Fin.snoc (Fin.snoc (Fin.snoc u a) a_1) a_2) = mEncodeCfg b ∧
mTracesTo refM (fn₁ (Fin.snoc (Fin.snoc (Fin.snoc u a) a_1) a_2)) a_3 b) ∧
∃ a_3 b,
fbi (Fin.snoc (Fin.snoc (Fin.snoc u a) a_1) a_2) = mEncodeCfg a_3 ∧
fx₂ (Fin.snoc (Fin.snoc (Fin.snoc u a) a_1) a_2) = mEncodeCfg b ∧ mTracesTo candM (↑↑r) a_3 b) ↔
∃ n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (u 0) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
refine exists_congr fun n₁ ↦ exists_congr fun x₁ ↦ exists_congr fun x₂ ↦ ?_ M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hi_le:PADefN 1 fun u ↦ u 0 ≤ Nr:Fin 9fn₁:(Fin 4 → PAM M) → PAM M := fun w ↦ w 1fx₁:(Fin 4 → PAM M) → PAM M := fun w ↦ w 2fx₂:(Fin 4 → PAM M) → PAM M := fun w ↦ w 3fbi:(Fin 4 → PAM M) → PAM M := fun w ↦ c₀.mBeta d₀ (w 0)hn₁:PAFunN 4 fn₁hx₁:PAFunN 4 fx₁hx₂:PAFunN 4 fx₂hbi:PAFunN 4 fbihbody:PADefN 4 fun args ↦
(∃ c₁ c₂, fx₁ args = mEncodeCfg c₁ ∧ fx₂ args = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ a b, mEncodeCfg a₁ = mEncodeCfg a ∧ fx₁ args = mEncodeCfg b ∧ mTracesTo refM (fn₁ args) a b) ∧
∃ a b, fbi args = mEncodeCfg a ∧ fx₂ args = mEncodeCfg b ∧ mTracesTo candM (↑↑r) a bu:Fin 1 → PAM Mn₁:PAM Mx₁:PAM Mx₂:PAM M⊢ ((∃ c₁ c₂,
fx₁ (Fin.snoc (Fin.snoc (Fin.snoc u n₁) x₁) x₂) = mEncodeCfg c₁ ∧
fx₂ (Fin.snoc (Fin.snoc (Fin.snoc u n₁) x₁) x₂) = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ a b,
mEncodeCfg a₁ = mEncodeCfg a ∧
fx₁ (Fin.snoc (Fin.snoc (Fin.snoc u n₁) x₁) x₂) = mEncodeCfg b ∧
mTracesTo refM (fn₁ (Fin.snoc (Fin.snoc (Fin.snoc u n₁) x₁) x₂)) a b) ∧
∃ a b,
fbi (Fin.snoc (Fin.snoc (Fin.snoc u n₁) x₁) x₂) = mEncodeCfg a ∧
fx₂ (Fin.snoc (Fin.snoc (Fin.snoc u n₁) x₁) x₂) = mEncodeCfg b ∧ mTracesTo candM (↑↑r) a b) ↔
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (u 0) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
dsimp only [fn₁, fx₁, fx₂, fbi] M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hi_le:PADefN 1 fun u ↦ u 0 ≤ Nr:Fin 9fn₁:(Fin 4 → PAM M) → PAM M := fun w ↦ w 1fx₁:(Fin 4 → PAM M) → PAM M := fun w ↦ w 2fx₂:(Fin 4 → PAM M) → PAM M := fun w ↦ w 3fbi:(Fin 4 → PAM M) → PAM M := fun w ↦ c₀.mBeta d₀ (w 0)hn₁:PAFunN 4 fn₁hx₁:PAFunN 4 fx₁hx₂:PAFunN 4 fx₂hbi:PAFunN 4 fbihbody:PADefN 4 fun args ↦
(∃ c₁ c₂, fx₁ args = mEncodeCfg c₁ ∧ fx₂ args = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ a b, mEncodeCfg a₁ = mEncodeCfg a ∧ fx₁ args = mEncodeCfg b ∧ mTracesTo refM (fn₁ args) a b) ∧
∃ a b, fbi args = mEncodeCfg a ∧ fx₂ args = mEncodeCfg b ∧ mTracesTo candM (↑↑r) a bu:Fin 1 → PAM Mn₁:PAM Mx₁:PAM Mx₂:PAM M⊢ ((∃ c₁ c₂,
Fin.snoc (Fin.snoc (Fin.snoc u n₁) x₁) x₂ 2 = mEncodeCfg c₁ ∧
Fin.snoc (Fin.snoc (Fin.snoc u n₁) x₁) x₂ 3 = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ a b,
mEncodeCfg a₁ = mEncodeCfg a ∧
Fin.snoc (Fin.snoc (Fin.snoc u n₁) x₁) x₂ 2 = mEncodeCfg b ∧
mTracesTo refM (Fin.snoc (Fin.snoc (Fin.snoc u n₁) x₁) x₂ 1) a b) ∧
∃ a b,
c₀.mBeta d₀ (Fin.snoc (Fin.snoc (Fin.snoc u n₁) x₁) x₂ 0) = mEncodeCfg a ∧
Fin.snoc (Fin.snoc (Fin.snoc u n₁) x₁) x₂ 3 = mEncodeCfg b ∧ mTracesTo candM (↑↑r) a b) ↔
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (u 0) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
simp [Fin.snoc] M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hi_le:PADefN 1 fun u ↦ u 0 ≤ Nhr_case:∀ (r : Fin 9),
PADefN 1 fun u ↦
∃ n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (u 0) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂⊢ PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
exact paDef_imp hi_le (paDef_fin_exists hr_case) M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂⊢ mHaltsFrom refM a₁
have hsim := ind1 hdef ?_ ?_ N le_rfl refine_3 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hsim:∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ N = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂⊢ mHaltsFrom refM a₁refine_1 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂⊢ 0 ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ 0 = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂refine_2 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂⊢ ∀ (a : PAM M),
(a ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ a = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂) →
a + 1 ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (a + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
· refine_3 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hsim:∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ N = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂⊢ mHaltsFrom refM a₁ rcases hsim with ⟨r, n₁, x₁, x₂, ⟨c₁, c₂, hx₁, hx₂, hrel⟩,
⟨u₁, c₁', hu₁, hx₁', htr₁⟩, ⟨b₂, c₂', hb₂, hx₂', htr_r⟩⟩ refine_3 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂r:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂u₁:MCfg 393 Mc₁':MCfg 393 Mhu₁:mEncodeCfg a₁ = mEncodeCfg u₁hx₁':x₁ = mEncodeCfg c₁'htr₁:mTracesTo refM n₁ u₁ c₁'b₂:MCfg 380 Mc₂':MCfg 380 Mhb₂:c₀.mBeta d₀ N = mEncodeCfg b₂hx₂':x₂ = mEncodeCfg c₂'htr_r:mTracesTo candM (↑↑r) b₂ c₂'⊢ mHaltsFrom refM a₁
have hu₁a : u₁ = a₁ := mEncodeCfg_injective hu₁.symm refine_3 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂r:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂u₁:MCfg 393 Mc₁':MCfg 393 Mhu₁:mEncodeCfg a₁ = mEncodeCfg u₁hx₁':x₁ = mEncodeCfg c₁'htr₁:mTracesTo refM n₁ u₁ c₁'b₂:MCfg 380 Mc₂':MCfg 380 Mhb₂:c₀.mBeta d₀ N = mEncodeCfg b₂hx₂':x₂ = mEncodeCfg c₂'htr_r:mTracesTo candM (↑↑r) b₂ c₂'hu₁a:u₁ = a₁⊢ mHaltsFrom refM a₁
have hc₁eq : c₁' = c₁ := mEncodeCfg_injective (hx₁'.symm.trans hx₁) refine_3 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂r:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂u₁:MCfg 393 Mc₁':MCfg 393 Mhu₁:mEncodeCfg a₁ = mEncodeCfg u₁hx₁':x₁ = mEncodeCfg c₁'htr₁:mTracesTo refM n₁ u₁ c₁'b₂:MCfg 380 Mc₂':MCfg 380 Mhb₂:c₀.mBeta d₀ N = mEncodeCfg b₂hx₂':x₂ = mEncodeCfg c₂'htr_r:mTracesTo candM (↑↑r) b₂ c₂'hu₁a:u₁ = a₁hc₁eq:c₁' = c₁⊢ mHaltsFrom refM a₁
have hc₂eq : c₂' = c₂ := mEncodeCfg_injective (hx₂'.symm.trans hx₂) refine_3 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂r:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂u₁:MCfg 393 Mc₁':MCfg 393 Mhu₁:mEncodeCfg a₁ = mEncodeCfg u₁hx₁':x₁ = mEncodeCfg c₁'htr₁:mTracesTo refM n₁ u₁ c₁'b₂:MCfg 380 Mc₂':MCfg 380 Mhb₂:c₀.mBeta d₀ N = mEncodeCfg b₂hx₂':x₂ = mEncodeCfg c₂'htr_r:mTracesTo candM (↑↑r) b₂ c₂'hu₁a:u₁ = a₁hc₁eq:c₁' = c₁hc₂eq:c₂' = c₂⊢ mHaltsFrom refM a₁
have hb₂f : b₂ = f₂ := mEncodeCfg_injective (hb₂.symm.trans hN) refine_3 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂r:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂u₁:MCfg 393 Mc₁':MCfg 393 Mhu₁:mEncodeCfg a₁ = mEncodeCfg u₁hx₁':x₁ = mEncodeCfg c₁'htr₁:mTracesTo refM n₁ u₁ c₁'b₂:MCfg 380 Mc₂':MCfg 380 Mhb₂:c₀.mBeta d₀ N = mEncodeCfg b₂hx₂':x₂ = mEncodeCfg c₂'htr_r:mTracesTo candM (↑↑r) b₂ c₂'hu₁a:u₁ = a₁hc₁eq:c₁' = c₁hc₂eq:c₂' = c₂hb₂f:b₂ = f₂⊢ mHaltsFrom refM a₁
subst u₁ c₁' c₂' b₂ refine_3 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂r:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hx₂':x₂ = mEncodeCfg c₂hb₂:c₀.mBeta d₀ N = mEncodeCfg f₂htr_r:mTracesTo candM (↑↑r) f₂ c₂⊢ mHaltsFrom refM a₁
have hns_r := (mTracesTo_natCast_iff_mNSteps r.val f₂ c₂).mp htr_r refine_3 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂r:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hx₂':x₂ = mEncodeCfg c₂hb₂:c₀.mBeta d₀ N = mEncodeCfg f₂htr_r:mTracesTo candM (↑↑r) f₂ c₂hns_r:mNSteps candM (↑r) f₂ = some c₂⊢ mHaltsFrom refM a₁
rcases hr : r.val with _ | r' refine_3.zero M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂r:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hx₂':x₂ = mEncodeCfg c₂hb₂:c₀.mBeta d₀ N = mEncodeCfg f₂htr_r:mTracesTo candM (↑↑r) f₂ c₂hns_r:mNSteps candM (↑r) f₂ = some c₂hr:↑r = 0⊢ mHaltsFrom refM a₁refine_3.succ M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂r:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hx₂':x₂ = mEncodeCfg c₂hb₂:c₀.mBeta d₀ N = mEncodeCfg f₂htr_r:mTracesTo candM (↑↑r) f₂ c₂hns_r:mNSteps candM (↑r) f₂ = some c₂r':ℕhr:↑r = r' + 1⊢ mHaltsFrom refM a₁
· refine_3.zero M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂r:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hx₂':x₂ = mEncodeCfg c₂hb₂:c₀.mBeta d₀ N = mEncodeCfg f₂htr_r:mTracesTo candM (↑↑r) f₂ c₂hns_r:mNSteps candM (↑r) f₂ = some c₂hr:↑r = 0⊢ mHaltsFrom refM a₁ rw [hr refine_3.zero M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂r:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hx₂':x₂ = mEncodeCfg c₂hb₂:c₀.mBeta d₀ N = mEncodeCfg f₂htr_r:mTracesTo candM (↑↑r) f₂ c₂hns_r:mNSteps candM 0 f₂ = some c₂hr:↑r = 0⊢ mHaltsFrom refM a₁] at hns_r refine_3.zero M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂r:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hx₂':x₂ = mEncodeCfg c₂hb₂:c₀.mBeta d₀ N = mEncodeCfg f₂htr_r:mTracesTo candM (↑↑r) f₂ c₂hns_r:mNSteps candM 0 f₂ = some c₂hr:↑r = 0⊢ mHaltsFrom refM a₁
simp only [mNSteps, Option.some.injEq] at hns_r refine_3.zero M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂r:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hx₂':x₂ = mEncodeCfg c₂hb₂:c₀.mBeta d₀ N = mEncodeCfg f₂htr_r:mTracesTo candM (↑↑r) f₂ c₂hr:↑r = 0hns_r:f₂ = c₂⊢ mHaltsFrom refM a₁
subst c₂ refine_3.zero M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂r:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mhx₁:x₁ = mEncodeCfg c₁hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hb₂:c₀.mBeta d₀ N = mEncodeCfg f₂hr:↑r = 0hx₂:x₂ = mEncodeCfg f₂hrel:MRel c₁ f₂hx₂':x₂ = mEncodeCfg f₂htr_r:mTracesTo candM (↑↑r) f₂ f₂⊢ mHaltsFrom refM a₁
have hres := mRespects hrel refine_3.zero M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂r:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mhx₁:x₁ = mEncodeCfg c₁hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hb₂:c₀.mBeta d₀ N = mEncodeCfg f₂hr:↑r = 0hx₂:x₂ = mEncodeCfg f₂hrel:MRel c₁ f₂hx₂':x₂ = mEncodeCfg f₂htr_r:mTracesTo candM (↑↑r) f₂ f₂hres:match mStep refM c₁ with
| none => mStep candM f₂ = none
| some c₁' => ∃ k c₂', MRel c₁' c₂' ∧ mNSteps candM (↑k + 1) f₂ = some c₂'⊢ mHaltsFrom refM a₁
rcases e : mStep refM c₁ with _ | d₁ refine_3.zero.none M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂r:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mhx₁:x₁ = mEncodeCfg c₁hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hb₂:c₀.mBeta d₀ N = mEncodeCfg f₂hr:↑r = 0hx₂:x₂ = mEncodeCfg f₂hrel:MRel c₁ f₂hx₂':x₂ = mEncodeCfg f₂htr_r:mTracesTo candM (↑↑r) f₂ f₂hres:match mStep refM c₁ with
| none => mStep candM f₂ = none
| some c₁' => ∃ k c₂', MRel c₁' c₂' ∧ mNSteps candM (↑k + 1) f₂ = some c₂'e:mStep refM c₁ = none⊢ mHaltsFrom refM a₁refine_3.zero.some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂r:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mhx₁:x₁ = mEncodeCfg c₁hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hb₂:c₀.mBeta d₀ N = mEncodeCfg f₂hr:↑r = 0hx₂:x₂ = mEncodeCfg f₂hrel:MRel c₁ f₂hx₂':x₂ = mEncodeCfg f₂htr_r:mTracesTo candM (↑↑r) f₂ f₂hres:match mStep refM c₁ with
| none => mStep candM f₂ = none
| some c₁' => ∃ k c₂', MRel c₁' c₂' ∧ mNSteps candM (↑k + 1) f₂ = some c₂'d₁:MCfg 393 Me:mStep refM c₁ = some d₁⊢ mHaltsFrom refM a₁
· refine_3.zero.none M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂r:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mhx₁:x₁ = mEncodeCfg c₁hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hb₂:c₀.mBeta d₀ N = mEncodeCfg f₂hr:↑r = 0hx₂:x₂ = mEncodeCfg f₂hrel:MRel c₁ f₂hx₂':x₂ = mEncodeCfg f₂htr_r:mTracesTo candM (↑↑r) f₂ f₂hres:match mStep refM c₁ with
| none => mStep candM f₂ = none
| some c₁' => ∃ k c₂', MRel c₁' c₂' ∧ mNSteps candM (↑k + 1) f₂ = some c₂'e:mStep refM c₁ = none⊢ mHaltsFrom refM a₁ exact ⟨n₁, c₁, htr₁, e⟩ All goals completed! 🐙
· refine_3.zero.some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂r:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mhx₁:x₁ = mEncodeCfg c₁hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hb₂:c₀.mBeta d₀ N = mEncodeCfg f₂hr:↑r = 0hx₂:x₂ = mEncodeCfg f₂hrel:MRel c₁ f₂hx₂':x₂ = mEncodeCfg f₂htr_r:mTracesTo candM (↑↑r) f₂ f₂hres:match mStep refM c₁ with
| none => mStep candM f₂ = none
| some c₁' => ∃ k c₂', MRel c₁' c₂' ∧ mNSteps candM (↑k + 1) f₂ = some c₂'d₁:MCfg 393 Me:mStep refM c₁ = some d₁⊢ mHaltsFrom refM a₁ rw [e refine_3.zero.some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂r:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mhx₁:x₁ = mEncodeCfg c₁hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hb₂:c₀.mBeta d₀ N = mEncodeCfg f₂hr:↑r = 0hx₂:x₂ = mEncodeCfg f₂hrel:MRel c₁ f₂hx₂':x₂ = mEncodeCfg f₂htr_r:mTracesTo candM (↑↑r) f₂ f₂d₁:MCfg 393 Mhres:match some d₁ with
| none => mStep candM f₂ = none
| some c₁' => ∃ k c₂', MRel c₁' c₂' ∧ mNSteps candM (↑k + 1) f₂ = some c₂'e:mStep refM c₁ = some d₁⊢ mHaltsFrom refM a₁] at hres refine_3.zero.some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂r:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mhx₁:x₁ = mEncodeCfg c₁hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hb₂:c₀.mBeta d₀ N = mEncodeCfg f₂hr:↑r = 0hx₂:x₂ = mEncodeCfg f₂hrel:MRel c₁ f₂hx₂':x₂ = mEncodeCfg f₂htr_r:mTracesTo candM (↑↑r) f₂ f₂d₁:MCfg 393 Mhres:match some d₁ with
| none => mStep candM f₂ = none
| some c₁' => ∃ k c₂', MRel c₁' c₂' ∧ mNSteps candM (↑k + 1) f₂ = some c₂'e:mStep refM c₁ = some d₁⊢ mHaltsFrom refM a₁
rcases hres with ⟨k, d₂, _, hnsk⟩ refine_3.zero.some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂r:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mhx₁:x₁ = mEncodeCfg c₁hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hb₂:c₀.mBeta d₀ N = mEncodeCfg f₂hr:↑r = 0hx₂:x₂ = mEncodeCfg f₂hrel:MRel c₁ f₂hx₂':x₂ = mEncodeCfg f₂htr_r:mTracesTo candM (↑↑r) f₂ f₂d₁:MCfg 393 Me:mStep refM c₁ = some d₁k:Fin 9d₂:MCfg 380 Mleft✝:MRel d₁ d₂hnsk:mNSteps candM (↑k + 1) f₂ = some d₂⊢ mHaltsFrom refM a₁
simp [mNSteps, hnone] at hnsk All goals completed! 🐙
· refine_3.succ M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂r:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hx₂':x₂ = mEncodeCfg c₂hb₂:c₀.mBeta d₀ N = mEncodeCfg f₂htr_r:mTracesTo candM (↑↑r) f₂ c₂hns_r:mNSteps candM (↑r) f₂ = some c₂r':ℕhr:↑r = r' + 1⊢ mHaltsFrom refM a₁ rw [hr refine_3.succ M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂r:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hx₂':x₂ = mEncodeCfg c₂hb₂:c₀.mBeta d₀ N = mEncodeCfg f₂htr_r:mTracesTo candM (↑↑r) f₂ c₂r':ℕhns_r:mNSteps candM (r' + 1) f₂ = some c₂hr:↑r = r' + 1⊢ mHaltsFrom refM a₁] at hns_r refine_3.succ M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂r:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hx₂':x₂ = mEncodeCfg c₂hb₂:c₀.mBeta d₀ N = mEncodeCfg f₂htr_r:mTracesTo candM (↑↑r) f₂ c₂r':ℕhns_r:mNSteps candM (r' + 1) f₂ = some c₂hr:↑r = r' + 1⊢ mHaltsFrom refM a₁
simp [mNSteps, hnone] at hns_r All goals completed! 🐙
· refine_1 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂⊢ 0 ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ 0 = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂ intro _ refine_1 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂a✝:0 ≤ N⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ 0 = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
exact ⟨⟨0, by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂a✝:0 ≤ N⊢ 0 < 9 decide All goals completed! 🐙⟩, 0, mEncodeCfg a₁, mEncodeCfg a₂,
⟨a₁, a₂, rfl, rfl, hrel₀⟩,
⟨a₁, a₁, rfl, rfl, mTracesTo_zero refM a₁⟩,
⟨a₂, a₂, h0, rfl, by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂a✝:0 ≤ N⊢ mTracesTo candM (↑↑⟨0, ⋯⟩) a₂ a₂ simpa using mTracesTo_zero candM a₂ All goals completed! 🐙⟩⟩
· refine_2 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂⊢ ∀ (a : PAM M),
(a ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ a = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂) →
a + 1 ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (a + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂ intro i ih hi1 refine_2 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ N⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
have hilt : i < N := hi1 refine_2 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < N⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
rcases ih (le_of_lt hilt) with ⟨r, n₁, x₁, x₂, ⟨c₁, c₂, hx₁, hx₂, hrel⟩,
⟨u₁, c₁', hu₁, hx₁', htr₁⟩, ⟨b₂, c₂', hb₂, hx₂', htr_r⟩⟩ refine_2 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < Nr:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂u₁:MCfg 393 Mc₁':MCfg 393 Mhu₁:mEncodeCfg a₁ = mEncodeCfg u₁hx₁':x₁ = mEncodeCfg c₁'htr₁:mTracesTo refM n₁ u₁ c₁'b₂:MCfg 380 Mc₂':MCfg 380 Mhb₂:c₀.mBeta d₀ i = mEncodeCfg b₂hx₂':x₂ = mEncodeCfg c₂'htr_r:mTracesTo candM (↑↑r) b₂ c₂'⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
have hu₁a : u₁ = a₁ := mEncodeCfg_injective hu₁.symm refine_2 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < Nr:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂u₁:MCfg 393 Mc₁':MCfg 393 Mhu₁:mEncodeCfg a₁ = mEncodeCfg u₁hx₁':x₁ = mEncodeCfg c₁'htr₁:mTracesTo refM n₁ u₁ c₁'b₂:MCfg 380 Mc₂':MCfg 380 Mhb₂:c₀.mBeta d₀ i = mEncodeCfg b₂hx₂':x₂ = mEncodeCfg c₂'htr_r:mTracesTo candM (↑↑r) b₂ c₂'hu₁a:u₁ = a₁⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
have hc₁eq : c₁' = c₁ := mEncodeCfg_injective (hx₁'.symm.trans hx₁) refine_2 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < Nr:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂u₁:MCfg 393 Mc₁':MCfg 393 Mhu₁:mEncodeCfg a₁ = mEncodeCfg u₁hx₁':x₁ = mEncodeCfg c₁'htr₁:mTracesTo refM n₁ u₁ c₁'b₂:MCfg 380 Mc₂':MCfg 380 Mhb₂:c₀.mBeta d₀ i = mEncodeCfg b₂hx₂':x₂ = mEncodeCfg c₂'htr_r:mTracesTo candM (↑↑r) b₂ c₂'hu₁a:u₁ = a₁hc₁eq:c₁' = c₁⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
have hc₂eq : c₂' = c₂ := mEncodeCfg_injective (hx₂'.symm.trans hx₂) refine_2 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < Nr:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂u₁:MCfg 393 Mc₁':MCfg 393 Mhu₁:mEncodeCfg a₁ = mEncodeCfg u₁hx₁':x₁ = mEncodeCfg c₁'htr₁:mTracesTo refM n₁ u₁ c₁'b₂:MCfg 380 Mc₂':MCfg 380 Mhb₂:c₀.mBeta d₀ i = mEncodeCfg b₂hx₂':x₂ = mEncodeCfg c₂'htr_r:mTracesTo candM (↑↑r) b₂ c₂'hu₁a:u₁ = a₁hc₁eq:c₁' = c₁hc₂eq:c₂' = c₂⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
subst u₁ c₁' c₂' refine_2 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < Nr:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂b₂:MCfg 380 Mhb₂:c₀.mBeta d₀ i = mEncodeCfg b₂hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hx₂':x₂ = mEncodeCfg c₂htr_r:mTracesTo candM (↑↑r) b₂ c₂⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
obtain ⟨p₂, q₂, hp₂, hq₂, hst₂⟩ := hsteps i hilt refine_2 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < Nr:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂b₂:MCfg 380 Mhb₂:c₀.mBeta d₀ i = mEncodeCfg b₂hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hx₂':x₂ = mEncodeCfg c₂htr_r:mTracesTo candM (↑↑r) b₂ c₂p₂:MCfg 380 Mq₂:MCfg 380 Mhp₂:c₀.mBeta d₀ i = mEncodeCfg p₂hq₂:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₂hst₂:mStep candM p₂ = some q₂⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
have hp₂b : p₂ = b₂ := mEncodeCfg_injective (hp₂.symm.trans hb₂) refine_2 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < Nr:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂b₂:MCfg 380 Mhb₂:c₀.mBeta d₀ i = mEncodeCfg b₂hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hx₂':x₂ = mEncodeCfg c₂htr_r:mTracesTo candM (↑↑r) b₂ c₂p₂:MCfg 380 Mq₂:MCfg 380 Mhp₂:c₀.mBeta d₀ i = mEncodeCfg p₂hq₂:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₂hst₂:mStep candM p₂ = some q₂hp₂b:p₂ = b₂⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
subst b₂ refine_2 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < Nr:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hx₂':x₂ = mEncodeCfg c₂p₂:MCfg 380 Mq₂:MCfg 380 Mhp₂:c₀.mBeta d₀ i = mEncodeCfg p₂hq₂:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₂hst₂:mStep candM p₂ = some q₂hb₂:c₀.mBeta d₀ i = mEncodeCfg p₂htr_r:mTracesTo candM (↑↑r) p₂ c₂⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
have hns_r := (mTracesTo_natCast_iff_mNSteps r.val p₂ c₂).mp htr_r refine_2 M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < Nr:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hx₂':x₂ = mEncodeCfg c₂p₂:MCfg 380 Mq₂:MCfg 380 Mhp₂:c₀.mBeta d₀ i = mEncodeCfg p₂hq₂:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₂hst₂:mStep candM p₂ = some q₂hb₂:c₀.mBeta d₀ i = mEncodeCfg p₂htr_r:mTracesTo candM (↑↑r) p₂ c₂hns_r:mNSteps candM (↑r) p₂ = some c₂⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
rcases hr : r.val with _ | r' refine_2.zero M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < Nr:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hx₂':x₂ = mEncodeCfg c₂p₂:MCfg 380 Mq₂:MCfg 380 Mhp₂:c₀.mBeta d₀ i = mEncodeCfg p₂hq₂:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₂hst₂:mStep candM p₂ = some q₂hb₂:c₀.mBeta d₀ i = mEncodeCfg p₂htr_r:mTracesTo candM (↑↑r) p₂ c₂hns_r:mNSteps candM (↑r) p₂ = some c₂hr:↑r = 0⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂refine_2.succ M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < Nr:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hx₂':x₂ = mEncodeCfg c₂p₂:MCfg 380 Mq₂:MCfg 380 Mhp₂:c₀.mBeta d₀ i = mEncodeCfg p₂hq₂:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₂hst₂:mStep candM p₂ = some q₂hb₂:c₀.mBeta d₀ i = mEncodeCfg p₂htr_r:mTracesTo candM (↑↑r) p₂ c₂hns_r:mNSteps candM (↑r) p₂ = some c₂r':ℕhr:↑r = r' + 1⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
· refine_2.zero M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < Nr:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hx₂':x₂ = mEncodeCfg c₂p₂:MCfg 380 Mq₂:MCfg 380 Mhp₂:c₀.mBeta d₀ i = mEncodeCfg p₂hq₂:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₂hst₂:mStep candM p₂ = some q₂hb₂:c₀.mBeta d₀ i = mEncodeCfg p₂htr_r:mTracesTo candM (↑↑r) p₂ c₂hns_r:mNSteps candM (↑r) p₂ = some c₂hr:↑r = 0⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂ rw [hr refine_2.zero M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < Nr:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hx₂':x₂ = mEncodeCfg c₂p₂:MCfg 380 Mq₂:MCfg 380 Mhp₂:c₀.mBeta d₀ i = mEncodeCfg p₂hq₂:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₂hst₂:mStep candM p₂ = some q₂hb₂:c₀.mBeta d₀ i = mEncodeCfg p₂htr_r:mTracesTo candM (↑↑r) p₂ c₂hns_r:mNSteps candM 0 p₂ = some c₂hr:↑r = 0⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂] at hns_r refine_2.zero M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < Nr:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hx₂':x₂ = mEncodeCfg c₂p₂:MCfg 380 Mq₂:MCfg 380 Mhp₂:c₀.mBeta d₀ i = mEncodeCfg p₂hq₂:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₂hst₂:mStep candM p₂ = some q₂hb₂:c₀.mBeta d₀ i = mEncodeCfg p₂htr_r:mTracesTo candM (↑↑r) p₂ c₂hns_r:mNSteps candM 0 p₂ = some c₂hr:↑r = 0⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
simp only [mNSteps, Option.some.injEq] at hns_r refine_2.zero M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < Nr:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hx₂':x₂ = mEncodeCfg c₂p₂:MCfg 380 Mq₂:MCfg 380 Mhp₂:c₀.mBeta d₀ i = mEncodeCfg p₂hq₂:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₂hst₂:mStep candM p₂ = some q₂hb₂:c₀.mBeta d₀ i = mEncodeCfg p₂htr_r:mTracesTo candM (↑↑r) p₂ c₂hr:↑r = 0hns_r:p₂ = c₂⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
subst c₂ refine_2.zero M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < Nr:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mhx₁:x₁ = mEncodeCfg c₁hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁p₂:MCfg 380 Mq₂:MCfg 380 Mhp₂:c₀.mBeta d₀ i = mEncodeCfg p₂hq₂:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₂hst₂:mStep candM p₂ = some q₂hb₂:c₀.mBeta d₀ i = mEncodeCfg p₂hr:↑r = 0hx₂:x₂ = mEncodeCfg p₂hrel:MRel c₁ p₂hx₂':x₂ = mEncodeCfg p₂htr_r:mTracesTo candM (↑↑r) p₂ p₂⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
have hres := mRespects hrel refine_2.zero M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < Nr:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mhx₁:x₁ = mEncodeCfg c₁hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁p₂:MCfg 380 Mq₂:MCfg 380 Mhp₂:c₀.mBeta d₀ i = mEncodeCfg p₂hq₂:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₂hst₂:mStep candM p₂ = some q₂hb₂:c₀.mBeta d₀ i = mEncodeCfg p₂hr:↑r = 0hx₂:x₂ = mEncodeCfg p₂hrel:MRel c₁ p₂hx₂':x₂ = mEncodeCfg p₂htr_r:mTracesTo candM (↑↑r) p₂ p₂hres:match mStep refM c₁ with
| none => mStep candM p₂ = none
| some c₁' => ∃ k c₂', MRel c₁' c₂' ∧ mNSteps candM (↑k + 1) p₂ = some c₂'⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
rcases e : mStep refM c₁ with _ | d₁ refine_2.zero.none M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < Nr:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mhx₁:x₁ = mEncodeCfg c₁hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁p₂:MCfg 380 Mq₂:MCfg 380 Mhp₂:c₀.mBeta d₀ i = mEncodeCfg p₂hq₂:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₂hst₂:mStep candM p₂ = some q₂hb₂:c₀.mBeta d₀ i = mEncodeCfg p₂hr:↑r = 0hx₂:x₂ = mEncodeCfg p₂hrel:MRel c₁ p₂hx₂':x₂ = mEncodeCfg p₂htr_r:mTracesTo candM (↑↑r) p₂ p₂hres:match mStep refM c₁ with
| none => mStep candM p₂ = none
| some c₁' => ∃ k c₂', MRel c₁' c₂' ∧ mNSteps candM (↑k + 1) p₂ = some c₂'e:mStep refM c₁ = none⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂refine_2.zero.some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < Nr:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mhx₁:x₁ = mEncodeCfg c₁hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁p₂:MCfg 380 Mq₂:MCfg 380 Mhp₂:c₀.mBeta d₀ i = mEncodeCfg p₂hq₂:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₂hst₂:mStep candM p₂ = some q₂hb₂:c₀.mBeta d₀ i = mEncodeCfg p₂hr:↑r = 0hx₂:x₂ = mEncodeCfg p₂hrel:MRel c₁ p₂hx₂':x₂ = mEncodeCfg p₂htr_r:mTracesTo candM (↑↑r) p₂ p₂hres:match mStep refM c₁ with
| none => mStep candM p₂ = none
| some c₁' => ∃ k c₂', MRel c₁' c₂' ∧ mNSteps candM (↑k + 1) p₂ = some c₂'d₁:MCfg 393 Me:mStep refM c₁ = some d₁⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
· refine_2.zero.none M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < Nr:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mhx₁:x₁ = mEncodeCfg c₁hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁p₂:MCfg 380 Mq₂:MCfg 380 Mhp₂:c₀.mBeta d₀ i = mEncodeCfg p₂hq₂:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₂hst₂:mStep candM p₂ = some q₂hb₂:c₀.mBeta d₀ i = mEncodeCfg p₂hr:↑r = 0hx₂:x₂ = mEncodeCfg p₂hrel:MRel c₁ p₂hx₂':x₂ = mEncodeCfg p₂htr_r:mTracesTo candM (↑↑r) p₂ p₂hres:match mStep refM c₁ with
| none => mStep candM p₂ = none
| some c₁' => ∃ k c₂', MRel c₁' c₂' ∧ mNSteps candM (↑k + 1) p₂ = some c₂'e:mStep refM c₁ = none⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂ rw [e refine_2.zero.none M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < Nr:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mhx₁:x₁ = mEncodeCfg c₁hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁p₂:MCfg 380 Mq₂:MCfg 380 Mhp₂:c₀.mBeta d₀ i = mEncodeCfg p₂hq₂:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₂hst₂:mStep candM p₂ = some q₂hb₂:c₀.mBeta d₀ i = mEncodeCfg p₂hr:↑r = 0hx₂:x₂ = mEncodeCfg p₂hrel:MRel c₁ p₂hx₂':x₂ = mEncodeCfg p₂htr_r:mTracesTo candM (↑↑r) p₂ p₂hres:match none with
| none => mStep candM p₂ = none
| some c₁' => ∃ k c₂', MRel c₁' c₂' ∧ mNSteps candM (↑k + 1) p₂ = some c₂'e:mStep refM c₁ = none⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂] at hres refine_2.zero.none M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < Nr:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mhx₁:x₁ = mEncodeCfg c₁hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁p₂:MCfg 380 Mq₂:MCfg 380 Mhp₂:c₀.mBeta d₀ i = mEncodeCfg p₂hq₂:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₂hst₂:mStep candM p₂ = some q₂hb₂:c₀.mBeta d₀ i = mEncodeCfg p₂hr:↑r = 0hx₂:x₂ = mEncodeCfg p₂hrel:MRel c₁ p₂hx₂':x₂ = mEncodeCfg p₂htr_r:mTracesTo candM (↑↑r) p₂ p₂hres:match none with
| none => mStep candM p₂ = none
| some c₁' => ∃ k c₂', MRel c₁' c₂' ∧ mNSteps candM (↑k + 1) p₂ = some c₂'e:mStep refM c₁ = none⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
rw [hres refine_2.zero.none M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < Nr:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mhx₁:x₁ = mEncodeCfg c₁hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁p₂:MCfg 380 Mq₂:MCfg 380 Mhp₂:c₀.mBeta d₀ i = mEncodeCfg p₂hq₂:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₂hst₂:none = some q₂hb₂:c₀.mBeta d₀ i = mEncodeCfg p₂hr:↑r = 0hx₂:x₂ = mEncodeCfg p₂hrel:MRel c₁ p₂hx₂':x₂ = mEncodeCfg p₂htr_r:mTracesTo candM (↑↑r) p₂ p₂hres:match none with
| none => mStep candM p₂ = none
| some c₁' => ∃ k c₂', MRel c₁' c₂' ∧ mNSteps candM (↑k + 1) p₂ = some c₂'e:mStep refM c₁ = none⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂] at hst₂ refine_2.zero.none M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < Nr:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mhx₁:x₁ = mEncodeCfg c₁hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁p₂:MCfg 380 Mq₂:MCfg 380 Mhp₂:c₀.mBeta d₀ i = mEncodeCfg p₂hq₂:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₂hst₂:none = some q₂hb₂:c₀.mBeta d₀ i = mEncodeCfg p₂hr:↑r = 0hx₂:x₂ = mEncodeCfg p₂hrel:MRel c₁ p₂hx₂':x₂ = mEncodeCfg p₂htr_r:mTracesTo candM (↑↑r) p₂ p₂hres:match none with
| none => mStep candM p₂ = none
| some c₁' => ∃ k c₂', MRel c₁' c₂' ∧ mNSteps candM (↑k + 1) p₂ = some c₂'e:mStep refM c₁ = none⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
cases hst₂ All goals completed! 🐙
· refine_2.zero.some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < Nr:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mhx₁:x₁ = mEncodeCfg c₁hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁p₂:MCfg 380 Mq₂:MCfg 380 Mhp₂:c₀.mBeta d₀ i = mEncodeCfg p₂hq₂:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₂hst₂:mStep candM p₂ = some q₂hb₂:c₀.mBeta d₀ i = mEncodeCfg p₂hr:↑r = 0hx₂:x₂ = mEncodeCfg p₂hrel:MRel c₁ p₂hx₂':x₂ = mEncodeCfg p₂htr_r:mTracesTo candM (↑↑r) p₂ p₂hres:match mStep refM c₁ with
| none => mStep candM p₂ = none
| some c₁' => ∃ k c₂', MRel c₁' c₂' ∧ mNSteps candM (↑k + 1) p₂ = some c₂'d₁:MCfg 393 Me:mStep refM c₁ = some d₁⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂ rw [e refine_2.zero.some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < Nr:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mhx₁:x₁ = mEncodeCfg c₁hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁p₂:MCfg 380 Mq₂:MCfg 380 Mhp₂:c₀.mBeta d₀ i = mEncodeCfg p₂hq₂:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₂hst₂:mStep candM p₂ = some q₂hb₂:c₀.mBeta d₀ i = mEncodeCfg p₂hr:↑r = 0hx₂:x₂ = mEncodeCfg p₂hrel:MRel c₁ p₂hx₂':x₂ = mEncodeCfg p₂htr_r:mTracesTo candM (↑↑r) p₂ p₂d₁:MCfg 393 Mhres:match some d₁ with
| none => mStep candM p₂ = none
| some c₁' => ∃ k c₂', MRel c₁' c₂' ∧ mNSteps candM (↑k + 1) p₂ = some c₂'e:mStep refM c₁ = some d₁⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂] at hres refine_2.zero.some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < Nr:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mhx₁:x₁ = mEncodeCfg c₁hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁p₂:MCfg 380 Mq₂:MCfg 380 Mhp₂:c₀.mBeta d₀ i = mEncodeCfg p₂hq₂:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₂hst₂:mStep candM p₂ = some q₂hb₂:c₀.mBeta d₀ i = mEncodeCfg p₂hr:↑r = 0hx₂:x₂ = mEncodeCfg p₂hrel:MRel c₁ p₂hx₂':x₂ = mEncodeCfg p₂htr_r:mTracesTo candM (↑↑r) p₂ p₂d₁:MCfg 393 Mhres:match some d₁ with
| none => mStep candM p₂ = none
| some c₁' => ∃ k c₂', MRel c₁' c₂' ∧ mNSteps candM (↑k + 1) p₂ = some c₂'e:mStep refM c₁ = some d₁⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
rcases hres with ⟨k, d₂, hrel', hnsk⟩ refine_2.zero.some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < Nr:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mhx₁:x₁ = mEncodeCfg c₁hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁p₂:MCfg 380 Mq₂:MCfg 380 Mhp₂:c₀.mBeta d₀ i = mEncodeCfg p₂hq₂:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₂hst₂:mStep candM p₂ = some q₂hb₂:c₀.mBeta d₀ i = mEncodeCfg p₂hr:↑r = 0hx₂:x₂ = mEncodeCfg p₂hrel:MRel c₁ p₂hx₂':x₂ = mEncodeCfg p₂htr_r:mTracesTo candM (↑↑r) p₂ p₂d₁:MCfg 393 Me:mStep refM c₁ = some d₁k:Fin 9d₂:MCfg 380 Mhrel':MRel d₁ d₂hnsk:mNSteps candM (↑k + 1) p₂ = some d₂⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
simp only [mNSteps, hst₂, Option.bind_some] at hnsk refine_2.zero.some M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < Nr:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mhx₁:x₁ = mEncodeCfg c₁hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁p₂:MCfg 380 Mq₂:MCfg 380 Mhp₂:c₀.mBeta d₀ i = mEncodeCfg p₂hq₂:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₂hst₂:mStep candM p₂ = some q₂hb₂:c₀.mBeta d₀ i = mEncodeCfg p₂hr:↑r = 0hx₂:x₂ = mEncodeCfg p₂hrel:MRel c₁ p₂hx₂':x₂ = mEncodeCfg p₂htr_r:mTracesTo candM (↑↑r) p₂ p₂d₁:MCfg 393 Me:mStep refM c₁ = some d₁k:Fin 9d₂:MCfg 380 Mhrel':MRel d₁ d₂hnsk:mNSteps candM (↑k) q₂ = some d₂⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
exact ⟨k, n₁ + 1, mEncodeCfg d₁, mEncodeCfg d₂,
⟨d₁, d₂, rfl, rfl, hrel'⟩,
⟨a₁, d₁, rfl, rfl, mTracesTo_snoc htr₁ e⟩,
⟨q₂, d₂, hq₂, rfl, mTracesTo_of_mNSteps hnsk⟩⟩ All goals completed! 🐙
· refine_2.succ M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < Nr:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hx₂':x₂ = mEncodeCfg c₂p₂:MCfg 380 Mq₂:MCfg 380 Mhp₂:c₀.mBeta d₀ i = mEncodeCfg p₂hq₂:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₂hst₂:mStep candM p₂ = some q₂hb₂:c₀.mBeta d₀ i = mEncodeCfg p₂htr_r:mTracesTo candM (↑↑r) p₂ c₂hns_r:mNSteps candM (↑r) p₂ = some c₂r':ℕhr:↑r = r' + 1⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂ rw [hr refine_2.succ M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < Nr:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hx₂':x₂ = mEncodeCfg c₂p₂:MCfg 380 Mq₂:MCfg 380 Mhp₂:c₀.mBeta d₀ i = mEncodeCfg p₂hq₂:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₂hst₂:mStep candM p₂ = some q₂hb₂:c₀.mBeta d₀ i = mEncodeCfg p₂htr_r:mTracesTo candM (↑↑r) p₂ c₂r':ℕhns_r:mNSteps candM (r' + 1) p₂ = some c₂hr:↑r = r' + 1⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂] at hns_r refine_2.succ M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < Nr:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hx₂':x₂ = mEncodeCfg c₂p₂:MCfg 380 Mq₂:MCfg 380 Mhp₂:c₀.mBeta d₀ i = mEncodeCfg p₂hq₂:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₂hst₂:mStep candM p₂ = some q₂hb₂:c₀.mBeta d₀ i = mEncodeCfg p₂htr_r:mTracesTo candM (↑↑r) p₂ c₂r':ℕhns_r:mNSteps candM (r' + 1) p₂ = some c₂hr:↑r = r' + 1⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
simp only [mNSteps, hst₂, Option.bind_some] at hns_r refine_2.succ M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < Nr:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hx₂':x₂ = mEncodeCfg c₂p₂:MCfg 380 Mq₂:MCfg 380 Mhp₂:c₀.mBeta d₀ i = mEncodeCfg p₂hq₂:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₂hst₂:mStep candM p₂ = some q₂hb₂:c₀.mBeta d₀ i = mEncodeCfg p₂htr_r:mTracesTo candM (↑↑r) p₂ c₂r':ℕhr:↑r = r' + 1hns_r:mNSteps candM r' q₂ = some c₂⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
have hr'_lt : r' < 9 := by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂hhalts:mHaltsFrom candM a₂⊢ mHaltsFrom refM a₁ have := r.isLt M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < Nr:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hx₂':x₂ = mEncodeCfg c₂p₂:MCfg 380 Mq₂:MCfg 380 Mhp₂:c₀.mBeta d₀ i = mEncodeCfg p₂hq₂:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₂hst₂:mStep candM p₂ = some q₂hb₂:c₀.mBeta d₀ i = mEncodeCfg p₂htr_r:mTracesTo candM (↑↑r) p₂ c₂r':ℕhr:↑r = r' + 1hns_r:mNSteps candM r' q₂ = some c₂this:↑r < 9⊢ r' < 9; omega refine_2.succ M:Type u_1inst✝¹:PAStructure Minst✝:PAModel Ma₁:MCfg 393 Ma₂:MCfg 380 Mhrel₀:MRel a₁ a₂N:PAM Mf₂:MCfg 380 Mhnone:mStep candM f₂ = nonec₀:PAM Md₀:PAM Mh0:c₀.mBeta d₀ 0 = mEncodeCfg a₂hsteps:∀ i < N, ∃ x y, c₀.mBeta d₀ i = mEncodeCfg x ∧ c₀.mBeta d₀ (i + 1) = mEncodeCfg y ∧ mStep candM x = some yhN:c₀.mBeta d₀ N = mEncodeCfg f₂hdef:PADef1 fun i ↦
i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂i:PAM Mih:i ≤ N →
∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ i = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂hi1:i + 1 ≤ Nhilt:i < Nr:Fin 9n₁:PAM Mx₁:PAM Mx₂:PAM Mc₁:MCfg 393 Mc₂:MCfg 380 Mhx₁:x₁ = mEncodeCfg c₁hx₂:x₂ = mEncodeCfg c₂hrel:MRel c₁ c₂hu₁:mEncodeCfg a₁ = mEncodeCfg a₁hx₁':x₁ = mEncodeCfg c₁htr₁:mTracesTo refM n₁ a₁ c₁hx₂':x₂ = mEncodeCfg c₂p₂:MCfg 380 Mq₂:MCfg 380 Mhp₂:c₀.mBeta d₀ i = mEncodeCfg p₂hq₂:c₀.mBeta d₀ (i + 1) = mEncodeCfg q₂hst₂:mStep candM p₂ = some q₂hb₂:c₀.mBeta d₀ i = mEncodeCfg p₂htr_r:mTracesTo candM (↑↑r) p₂ c₂r':ℕhr:↑r = r' + 1hns_r:mNSteps candM r' q₂ = some c₂hr'_lt:r' < 9⊢ ∃ r n₁ x₁ x₂,
(∃ c₁ c₂, x₁ = mEncodeCfg c₁ ∧ x₂ = mEncodeCfg c₂ ∧ MRel c₁ c₂) ∧
(∃ u₁ c₁, mEncodeCfg a₁ = mEncodeCfg u₁ ∧ x₁ = mEncodeCfg c₁ ∧ mTracesTo refM n₁ u₁ c₁) ∧
∃ b₂ c₂, c₀.mBeta d₀ (i + 1) = mEncodeCfg b₂ ∧ x₂ = mEncodeCfg c₂ ∧ mTracesTo candM (↑↑r) b₂ c₂
exact ⟨⟨r', hr'_lt⟩, n₁, mEncodeCfg c₁, mEncodeCfg c₂,
⟨c₁, c₂, rfl, rfl, hrel⟩,
⟨a₁, c₁, rfl, rfl, htr₁⟩,
⟨q₂, c₂, hq₂, rfl, mTracesTo_of_mNSteps hns_r⟩⟩ All goals completed! 🐙
In every first-order PAModel M, Machines.zf380 halts iff Machines.zf393 halts.
theorem mHalts_zf380_iff_zf393 :
mHalts M Machines.zf380 ↔ mHalts M Machines.zf393 := by M:Type u_1inst✝¹:PAStructure Minst✝:PAModel M⊢ mHalts M Machines.zf380 ↔ mHalts M Machines.zf393
unfold mHalts M:Type u_1inst✝¹:PAStructure Minst✝:PAModel M⊢ mHaltsFrom Machines.zf380 mInit ↔ mHaltsFrom Machines.zf393 mInit
rw [mHaltsFrom_iff_of_mTracesTo (mBoot_cand (M := M)), M:Type u_1inst✝¹:PAStructure Minst✝:PAModel M⊢ mHaltsFrom Machines.zf380 (embedCfg (cfgOfFast 64 [] 0 bootR_39753)) ↔ mHaltsFrom Machines.zf393 mInit
mHaltsFrom_iff_of_mTracesTo (mBoot_ref (M := M)) M:Type u_1inst✝¹:PAStructure Minst✝:PAModel M⊢ mHaltsFrom Machines.zf380 (embedCfg (cfgOfFast 64 [] 0 bootR_39753)) ↔
mHaltsFrom Machines.zf393 (embedCfg (cfgOfFast 64 [] 0 bootR_39753))] M:Type u_1inst✝¹:PAStructure Minst✝:PAModel M⊢ mHaltsFrom Machines.zf380 (embedCfg (cfgOfFast 64 [] 0 bootR_39753)) ↔
mHaltsFrom Machines.zf393 (embedCfg (cfgOfFast 64 [] 0 bootR_39753))
exact ⟨mHaltsFrom_ref_of_cand mRel_boot, mHaltsFrom_cand_of_ref mRel_boot⟩ All goals completed! 🐙end Model
Peano Arithmetic proves that zf_380 halts if and only if zf_393 halts.
theorem paProvable_halts_zf380_iff_zf393 :
PAProvable ((paHalts Machines.zf380).iff (paHalts Machines.zf393)) := by ⊢ PAProvable ((paHalts Machines.zf380).iff (paHalts Machines.zf393))
rw [paProvable_iff_holdsIn_all_models ⊢ ∀ (M : Type) [inst : PAStructure M] [PAModel M] (v : ℕ → M),
PAFormula.HoldsIn v ((paHalts Machines.zf380).iff (paHalts Machines.zf393))] ⊢ ∀ (M : Type) [inst : PAStructure M] [PAModel M] (v : ℕ → M),
PAFormula.HoldsIn v ((paHalts Machines.zf380).iff (paHalts Machines.zf393))
intro M _ _ v M:Typeinst✝¹:PAStructure Minst✝:PAModel Mv:ℕ → M⊢ PAFormula.HoldsIn v ((paHalts Machines.zf380).iff (paHalts Machines.zf393))
rw [← PAM.holdsIn_iff_raw (fun x ↦ ⟨v x⟩) M:Typeinst✝¹:PAStructure Minst✝:PAModel Mv:ℕ → M⊢ PAFormula.HoldsIn (fun x ↦ { raw := v x }) ((paHalts Machines.zf380).iff (paHalts Machines.zf393))] M:Typeinst✝¹:PAStructure Minst✝:PAModel Mv:ℕ → M⊢ PAFormula.HoldsIn (fun x ↦ { raw := v x }) ((paHalts Machines.zf380).iff (paHalts Machines.zf393))
simp only [PAFormula.HoldsIn, paHalts_holdsIn_iff] M:Typeinst✝¹:PAStructure Minst✝:PAModel Mv:ℕ → M⊢ (mHalts M Machines.zf380 → mHalts M Machines.zf393) ∧ (mHalts M Machines.zf393 → mHalts M Machines.zf380)
exact ⟨(mHalts_zf380_iff_zf393 (M := M)).mp, (mHalts_zf380_iff_zf393 (M := M)).mpr⟩ All goals completed! 🐙end ConjectureMachines.Semantics.PA